Skip to content

Commit 99975fe

Browse files
committed
More rearranging
1 parent ee88f05 commit 99975fe

File tree

1 file changed

+70
-61
lines changed

1 file changed

+70
-61
lines changed

plugwise/constants.py

Lines changed: 70 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -31,29 +31,6 @@
3131
VOLUME_CUBIC_METERS: Final = "m³"
3232
VOLUME_CUBIC_METERS_PER_HOUR: Final = "m³/h"
3333

34-
ACTUATOR_CLASSES: Final[tuple[str, ...]] = (
35-
"heater_central",
36-
"thermostat",
37-
"thermostatic_radiator_valve",
38-
"zone_thermometer",
39-
"zone_thermostat",
40-
)
41-
ActuatorType = Literal[
42-
"domestic_hot_water_setpoint",
43-
"max_dhw_temperature",
44-
"maximum_boiler_temperature",
45-
"temperature_offset",
46-
"thermostat",
47-
]
48-
ACTIVE_ACTUATORS: Final[tuple[str, ...]] = get_args(ActuatorType)
49-
ActuatorDataType = Literal[
50-
"lower_bound",
51-
"resolution",
52-
"setpoint",
53-
"setpoint_high",
54-
"setpoint_low",
55-
"upper_bound",
56-
]
5734
DAYS: Final[dict[str, int]] = {
5835
"mo": 0,
5936
"tu": 1,
@@ -108,36 +85,10 @@
10885
"070051": "Switch",
10986
"080029": "Switch",
11087
}
111-
LIMITS: Final[tuple[str, ...]] = (
112-
"offset",
113-
"setpoint",
114-
"resolution",
115-
"lower_bound",
116-
"upper_bound",
117-
)
88+
11889
MAX_SETPOINT: Final[float] = 30.0
11990
MIN_SETPOINT: Final[float] = 4.0
12091
NONE: Final = "None"
121-
SPECIAL_FORMAT: Final[tuple[str, ...]] = (ENERGY_KILO_WATT_HOUR, VOLUME_CUBIC_METERS)
122-
SWITCH_GROUP_TYPES: Final[tuple[str, ...]] = ("switching", "report")
123-
ZONE_THERMOSTATS: Final[tuple[str, ...]] = (
124-
"thermostat",
125-
"thermostatic_radiator_valve",
126-
"zone_thermometer",
127-
"zone_thermostat",
128-
)
129-
THERMOSTAT_CLASSES: Final[tuple[str, ...]] = (
130-
"thermostat",
131-
"thermo_sensor",
132-
"zone_thermometer",
133-
"zone_thermostat",
134-
"thermostatic_radiator_valve",
135-
)
136-
SPECIAL_PLUG_TYPES: Final[tuple[str, ...]] = (
137-
"central_heating_pump",
138-
"valve_actuator",
139-
"heater_electric",
140-
)
14192

14293
# XML data paths
14394
APPLIANCES: Final = "/core/appliances"
@@ -151,6 +102,7 @@
151102

152103
UOM = namedtuple("UOM", "unit_of_measurement")
153104
DATA = namedtuple("DATA", "name unit_of_measurement")
105+
154106
# P1 related measurements:
155107
P1_MEASUREMENTS: Final[dict[str, UOM]] = {
156108
"electricity_consumed": UOM(POWER_WATT),
@@ -234,15 +186,6 @@
234186
"outdoor_temperature": DATA("outdoor_air_temperature", TEMP_CELSIUS),
235187
}
236188

237-
ToggleNameType = Literal[
238-
"cooling_ena_switch",
239-
"dhw_cm_switch",
240-
]
241-
TOGGLES: Final[dict[str, ToggleNameType]] = {
242-
"cooling_enabled": "cooling_ena_switch",
243-
"domestic_hot_water_comfort_mode": "dhw_cm_switch",
244-
}
245-
246189
# Known types of Smiles and Stretches
247190
SMILE = namedtuple("SMILE", "smile_type smile_name")
248191
SMILES: Final[dict[str, SMILE]] = {
@@ -258,7 +201,32 @@
258201
"stretch_v3": SMILE("stretch", "Stretch"),
259202
}
260203

261-
# All available Binary Sensor, Sensor, and Switch Types
204+
# Class, Literal and related tuple-definitions
205+
206+
ACTUATOR_CLASSES: Final[tuple[str, ...]] = (
207+
"heater_central",
208+
"thermostat",
209+
"thermostatic_radiator_valve",
210+
"zone_thermometer",
211+
"zone_thermostat",
212+
)
213+
ActuatorType = Literal[
214+
"domestic_hot_water_setpoint",
215+
"max_dhw_temperature",
216+
"maximum_boiler_temperature",
217+
"temperature_offset",
218+
"thermostat",
219+
]
220+
ACTIVE_ACTUATORS: Final[tuple[str, ...]] = get_args(ActuatorType)
221+
222+
ActuatorDataType = Literal[
223+
"lower_bound",
224+
"resolution",
225+
"setpoint",
226+
"setpoint_high",
227+
"setpoint_low",
228+
"upper_bound",
229+
]
262230

263231
ApplianceType = Literal[
264232
"dev_class",
@@ -291,6 +259,14 @@
291259
"temperature_offset",
292260
]
293261

262+
LIMITS: Final[tuple[str, ...]] = (
263+
"offset",
264+
"setpoint",
265+
"resolution",
266+
"lower_bound",
267+
"upper_bound",
268+
)
269+
294270
SelectType = Literal[
295271
"select_dhw_mode",
296272
"select_regulation_mode",
@@ -357,6 +333,14 @@
357333
]
358334
SENSORS: Final[tuple[str, ...]] = get_args(SensorType)
359335

336+
SPECIAL_PLUG_TYPES: Final[tuple[str, ...]] = (
337+
"central_heating_pump",
338+
"valve_actuator",
339+
"heater_electric",
340+
)
341+
342+
SPECIAL_FORMAT: Final[tuple[str, ...]] = (ENERGY_KILO_WATT_HOUR, VOLUME_CUBIC_METERS)
343+
360344
SwitchType = Literal[
361345
"cooling_ena_switch",
362346
"dhw_cm_switch",
@@ -365,6 +349,32 @@
365349
]
366350
SWITCHES: Final[tuple[str, ...]] = get_args(SwitchType)
367351

352+
SWITCH_GROUP_TYPES: Final[tuple[str, ...]] = ("switching", "report")
353+
354+
THERMOSTAT_CLASSES: Final[tuple[str, ...]] = (
355+
"thermostat",
356+
"thermo_sensor",
357+
"zone_thermometer",
358+
"zone_thermostat",
359+
"thermostatic_radiator_valve",
360+
)
361+
362+
ToggleNameType = Literal[
363+
"cooling_ena_switch",
364+
"dhw_cm_switch",
365+
]
366+
TOGGLES: Final[dict[str, ToggleNameType]] = {
367+
"cooling_enabled": "cooling_ena_switch",
368+
"domestic_hot_water_comfort_mode": "dhw_cm_switch",
369+
}
370+
371+
ZONE_THERMOSTATS: Final[tuple[str, ...]] = (
372+
"thermostat",
373+
"thermostatic_radiator_valve",
374+
"zone_thermometer",
375+
"zone_thermostat",
376+
)
377+
368378

369379
class GatewayData(TypedDict, total=False):
370380
"""The Gateway Data class."""
@@ -434,7 +444,6 @@ class SmileSensors(TypedDict, total=False):
434444
electricity_produced_peak_interval: int
435445
electricity_produced_peak_point: int
436446
electricity_produced_point: float
437-
elga_status_code: int
438447
gas_consumed_cumulative: float
439448
gas_consumed_interval: float
440449
humidity: float

0 commit comments

Comments
 (0)