Home Assistant Unofficial Reference 2024.12.1
const.py
Go to the documentation of this file.
1 """Constants for Plugwise component."""
2 
3 from __future__ import annotations
4 
5 from datetime import timedelta
6 import logging
7 from typing import Final, Literal
8 
9 from homeassistant.const import Platform
10 
11 DOMAIN: Final = "plugwise"
12 
13 LOGGER = logging.getLogger(__package__)
14 
15 API: Final = "api"
16 FLOW_SMILE: Final = "smile (Adam/Anna/P1)"
17 FLOW_STRETCH: Final = "stretch (Stretch)"
18 FLOW_TYPE: Final = "flow_type"
19 GATEWAY: Final = "gateway"
20 GATEWAY_ID: Final = "gateway_id"
21 LOCATION: Final = "location"
22 PW_TYPE: Final = "plugwise_type"
23 REBOOT: Final = "reboot"
24 SMILE: Final = "smile"
25 STRETCH: Final = "stretch"
26 STRETCH_USERNAME: Final = "stretch"
27 
28 PLATFORMS: Final[list[str]] = [
29  Platform.BINARY_SENSOR,
30  Platform.BUTTON,
31  Platform.CLIMATE,
32  Platform.NUMBER,
33  Platform.SELECT,
34  Platform.SENSOR,
35  Platform.SWITCH,
36 ]
37 ZEROCONF_MAP: Final[dict[str, str]] = {
38  "smile": "Smile P1",
39  "smile_thermo": "Smile Anna",
40  "smile_open_therm": "Adam",
41  "stretch": "Stretch",
42 }
43 
44 type NumberType = Literal[
45  "maximum_boiler_temperature",
46  "max_dhw_temperature",
47  "temperature_offset",
48 ]
49 
50 type SelectType = Literal[
51  "select_dhw_mode",
52  "select_gateway_mode",
53  "select_regulation_mode",
54  "select_schedule",
55 ]
56 type SelectOptionsType = Literal[
57  "dhw_modes",
58  "gateway_modes",
59  "regulation_modes",
60  "available_schedules",
61 ]
62 
63 # Default directives
64 DEFAULT_MAX_TEMP: Final = 30
65 DEFAULT_MIN_TEMP: Final = 4
66 DEFAULT_PORT: Final = 80
67 DEFAULT_SCAN_INTERVAL: Final[dict[str, timedelta]] = {
68  "power": timedelta(seconds=10),
69  "stretch": timedelta(seconds=60),
70  "thermostat": timedelta(seconds=60),
71 }
72 DEFAULT_USERNAME: Final = "smile"
73 
74 MASTER_THERMOSTATS: Final[list[str]] = [
75  "thermostat",
76  "thermostatic_radiator_valve",
77  "zone_thermometer",
78  "zone_thermostat",
79 ]