3131VOLUME_CUBIC_METERS : Final = "m³"
3232VOLUME_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- ]
5734DAYS : Final [dict [str , int ]] = {
5835 "mo" : 0 ,
5936 "tu" : 1 ,
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+
11889MAX_SETPOINT : Final [float ] = 30.0
11990MIN_SETPOINT : Final [float ] = 4.0
12091NONE : 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
14394APPLIANCES : Final = "/core/appliances"
151102
152103UOM = namedtuple ("UOM" , "unit_of_measurement" )
153104DATA = namedtuple ("DATA" , "name unit_of_measurement" )
105+
154106# P1 related measurements:
155107P1_MEASUREMENTS : Final [dict [str , UOM ]] = {
156108 "electricity_consumed" : UOM (POWER_WATT ),
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
247190SMILE = namedtuple ("SMILE" , "smile_type smile_name" )
248191SMILES : Final [dict [str , SMILE ]] = {
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
263231ApplianceType = Literal [
264232 "dev_class" ,
291259 "temperature_offset" ,
292260]
293261
262+ LIMITS : Final [tuple [str , ...]] = (
263+ "offset" ,
264+ "setpoint" ,
265+ "resolution" ,
266+ "lower_bound" ,
267+ "upper_bound" ,
268+ )
269+
294270SelectType = Literal [
295271 "select_dhw_mode" ,
296272 "select_regulation_mode" ,
357333]
358334SENSORS : 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+
360344SwitchType = Literal [
361345 "cooling_ena_switch" ,
362346 "dhw_cm_switch" ,
365349]
366350SWITCHES : Final [tuple [str , ...]] = get_args (SwitchType )
367351
352+ SWITCH_GROUP_TYPES : Final [tuple [str , ...]] = ("switching" , "report" )
368353
369- class ApplianceData (TypedDict , total = False ):
370- """The Appliance Data class."""
354+ THERMOSTAT_CLASSES : Final [tuple [str , ...]] = (
355+ "thermostat" ,
356+ "thermo_sensor" ,
357+ "zone_thermometer" ,
358+ "zone_thermostat" ,
359+ "thermostatic_radiator_valve" ,
360+ )
371361
372- dev_class : str
373- firmware : str | None
374- hardware : str
375- location : str
376- mac_address : str | None
377- members : list [str ]
378- model : str
379- name : str
380- vendor : str
381- zigbee_mac_address : str | None
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+ )
382377
383378
384379class GatewayData (TypedDict , total = False ):
@@ -449,7 +444,6 @@ class SmileSensors(TypedDict, total=False):
449444 electricity_produced_peak_interval : int
450445 electricity_produced_peak_point : int
451446 electricity_produced_point : float
452- elga_status_code : int
453447 gas_consumed_cumulative : float
454448 gas_consumed_interval : float
455449 humidity : float
@@ -502,16 +496,30 @@ class ActuatorData(TypedDict, total=False):
502496 upper_bound : float
503497
504498
505- class DeviceData (
506- ApplianceData ,
507- SmileBinarySensors ,
508- SmileSensors ,
509- SmileSwitches ,
510- TypedDict ,
511- total = False ,
512- ):
499+ class DeviceData (TypedDict , total = False ):
513500 """The Device Data class, covering the collected and ordered output-data per device."""
514501
502+ # Appliance base data
503+ dev_class : str
504+ firmware : str | None
505+ hardware : str
506+ location : str
507+ mac_address : str | None
508+ members : list [str ]
509+ model : str
510+ name : str
511+ vendor : str
512+ zigbee_mac_address : str | None
513+
514+ # For temporary use
515+ cooling_enabled : bool
516+ domestic_hot_water_setpoint : float
517+ elga_status_code : int
518+ c_heating_state : bool
519+
520+ # Device availability
521+ available : bool | None
522+
515523 # Loria
516524 select_dhw_mode : str
517525 dhw_modes : list [str ]
@@ -521,31 +529,25 @@ class DeviceData(
521529 regulation_modes : list [str ]
522530
523531 # Master Thermostats
524- preset_modes : list [ str ] | None
532+ # Presets:
525533 active_preset : str | None
526-
534+ preset_modes : list [str ] | None
535+ # Schedules:
527536 available_schedules : list [str ]
528- select_schedule : str
529537 last_used : str | None
538+ select_schedule : str
530539
531540 mode : str
532-
533541 # Extra for Adam Master Thermostats
534542 control_state : str | bool
535543
536- # For temporary use
537- c_heating_state : bool
538- modified : str
539-
540- # Device availability
541- available : bool | None
542-
544+ # Dict-types
543545 binary_sensors : SmileBinarySensors
544546 max_dhw_temperature : ActuatorData
545547 maximum_boiler_temperature : ActuatorData
546- temperature_offset : ActuatorData
547548 sensors : SmileSensors
548549 switches : SmileSwitches
550+ temperature_offset : ActuatorData
549551 thermostat : ActuatorData
550552
551553
0 commit comments