|
31 | 31 | VOLUME_CUBIC_METERS: Final = "m³" |
32 | 32 | VOLUME_CUBIC_METERS_PER_HOUR: Final = "m³/h" |
33 | 33 |
|
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 | | -] |
57 | 34 | DAYS: Final[dict[str, int]] = { |
58 | 35 | "mo": 0, |
59 | 36 | "tu": 1, |
|
108 | 85 | "070051": "Switch", |
109 | 86 | "080029": "Switch", |
110 | 87 | } |
111 | | -LIMITS: Final[tuple[str, ...]] = ( |
112 | | - "offset", |
113 | | - "setpoint", |
114 | | - "resolution", |
115 | | - "lower_bound", |
116 | | - "upper_bound", |
117 | | -) |
| 88 | + |
118 | 89 | MAX_SETPOINT: Final[float] = 30.0 |
119 | 90 | MIN_SETPOINT: Final[float] = 4.0 |
120 | 91 | 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 | | -) |
141 | 92 |
|
142 | 93 | # XML data paths |
143 | 94 | APPLIANCES: Final = "/core/appliances" |
|
151 | 102 |
|
152 | 103 | UOM = namedtuple("UOM", "unit_of_measurement") |
153 | 104 | DATA = namedtuple("DATA", "name unit_of_measurement") |
| 105 | + |
154 | 106 | # P1 related measurements: |
155 | 107 | P1_MEASUREMENTS: Final[dict[str, UOM]] = { |
156 | 108 | "electricity_consumed": UOM(POWER_WATT), |
|
234 | 186 | "outdoor_temperature": DATA("outdoor_air_temperature", TEMP_CELSIUS), |
235 | 187 | } |
236 | 188 |
|
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 | | - |
246 | 189 | # Known types of Smiles and Stretches |
247 | 190 | SMILE = namedtuple("SMILE", "smile_type smile_name") |
248 | 191 | SMILES: Final[dict[str, SMILE]] = { |
|
258 | 201 | "stretch_v3": SMILE("stretch", "Stretch"), |
259 | 202 | } |
260 | 203 |
|
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 | +] |
262 | 230 |
|
263 | 231 | ApplianceType = Literal[ |
264 | 232 | "dev_class", |
|
291 | 259 | "temperature_offset", |
292 | 260 | ] |
293 | 261 |
|
| 262 | +LIMITS: Final[tuple[str, ...]] = ( |
| 263 | + "offset", |
| 264 | + "setpoint", |
| 265 | + "resolution", |
| 266 | + "lower_bound", |
| 267 | + "upper_bound", |
| 268 | +) |
| 269 | + |
294 | 270 | SelectType = Literal[ |
295 | 271 | "select_dhw_mode", |
296 | 272 | "select_regulation_mode", |
|
357 | 333 | ] |
358 | 334 | SENSORS: Final[tuple[str, ...]] = get_args(SensorType) |
359 | 335 |
|
| 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 | + |
360 | 344 | SwitchType = Literal[ |
361 | 345 | "cooling_ena_switch", |
362 | 346 | "dhw_cm_switch", |
|
365 | 349 | ] |
366 | 350 | SWITCHES: Final[tuple[str, ...]] = get_args(SwitchType) |
367 | 351 |
|
| 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 | + |
368 | 378 |
|
369 | 379 | class GatewayData(TypedDict, total=False): |
370 | 380 | """The Gateway Data class.""" |
@@ -434,7 +444,6 @@ class SmileSensors(TypedDict, total=False): |
434 | 444 | electricity_produced_peak_interval: int |
435 | 445 | electricity_produced_peak_point: int |
436 | 446 | electricity_produced_point: float |
437 | | - elga_status_code: int |
438 | 447 | gas_consumed_cumulative: float |
439 | 448 | gas_consumed_interval: float |
440 | 449 | humidity: float |
|
0 commit comments