@@ -111,18 +111,6 @@ class SmartEnergySensors:
111
111
voltage_phase_two : float | None
112
112
113
113
114
- @dataclass
115
- class SmartEnergyLegacyMeter :
116
- """Legacy DSMR Energy Meter data class."""
117
-
118
- available : bool
119
- dev_class : str
120
- location : str
121
- model : str
122
- name : str
123
- sensors : SmartEnergyLegacySensors
124
- vendor : str
125
-
126
114
127
115
@dataclass
128
116
class SmartEnergyLegacySensors :
@@ -144,91 +132,93 @@ class SmartEnergyLegacySensors:
144
132
net_electricity_point : int
145
133
146
134
147
- class AnnaData (TypedDict , total = False ):
148
- """Plugwise Anna data class."""
135
+ @dataclass
136
+ class AnnaData :
137
+ """Plugwise Anna data class, also for legacy Anna."""
149
138
150
- active_preset : str
139
+ active_preset : str | None
151
140
available_schedules : list [str ]
141
+ climate_mode : str
142
+ control_state : str
152
143
dev_class : str
153
144
firmware : str
154
145
hardware : str
155
146
location : str
156
- mode : str
157
147
model : str
158
- model_id : str
159
148
name : str
160
- preset_modes : list [str ]
161
- select_schedule : str
149
+ preset_modes : list [str ] | None
150
+ select_schedule : str | None
162
151
sensors : AnnaSensors
163
- temperature_offset : SetpointDict
152
+ temperature_offset : SetpointDict | None # not for legacy
164
153
thermostat : ThermostatDict
165
154
vendor : str
166
155
167
156
168
- class AnnaSensors (TypedDict , total = False ):
157
+ @dataclass
158
+ class AnnaSensors :
169
159
"""Anna sensors class."""
170
160
171
- cooling_activation_outdoor_temperature : float
172
- cooling_deactivation_threshold : float
173
161
illuminance : float
174
- setpoint : float
175
- setpoint_high : float
176
- setpoint_low : float
162
+ setpoint : float | None
163
+ setpoint_high : float | None
164
+ setpoint_low : float | None
177
165
temperature : float
178
166
179
167
180
168
@dataclass
181
169
class ThermoZone :
182
170
"""Plugwise Adam ThermoZone data class."""
183
171
184
- active_preset : str
172
+ active_preset : str | None
185
173
available_schedules : list [str ]
186
174
climate_mode : str
187
175
control_state : str
176
+ dev_class : str
177
+ model : str
178
+ name : str
188
179
preset_modes : list [str ]
189
180
select_schedule : str
190
181
sensors : ThermoZoneSensors
191
182
thermostat : ThermostatDict
183
+ thermostats : ThermostatsDict
184
+ vendor : str
192
185
193
186
194
- class ThermoZoneSensors (TypedDict , total = False ):
187
+ @dataclass
188
+ class ThermoZoneSensors :
195
189
"""ThermoZone sensors class."""
196
190
197
- electricity_consumed : float
198
- electricity_produced : float
191
+ electricity_consumed : float | None # only with Plug(s) in the zone
192
+ electricity_produced : float | None # only with Plug(s) in the zone
199
193
temperature : float
200
194
201
195
202
- class AnnaAdamData (TypedDict , total = False ):
196
+ @dataclass
197
+ class AnnaAdamData :
203
198
"""Plugwise Anna-connected-to-Adam data class."""
204
199
205
- available : bool
206
200
dev_class : str
207
- firmware : str
208
- hardware : str
209
201
location : str
210
- mode : str
211
202
model : str
212
203
model_id : str
213
204
name : str
214
205
sensors : AnnaSensors
215
- temperature_offset : SetpointDict
216
206
vendor : str
217
207
218
208
219
- class JipLisaTomData (TypedDict , total = False ):
209
+ @dataclass
210
+ class JipLisaTomData :
220
211
"""JipLisaTomData data class.
221
212
222
213
Covering Plugwise Jip, Lisa and Tom/Floor devices.
223
214
"""
224
215
225
216
available : bool
226
- binary_sensors : WirelessThermostatBinarySensors
217
+ binary_sensors : WirelessThermostatBinarySensors | None # Not for AC powered Lisa/Tom
227
218
dev_class : str
228
219
firmware : str
229
220
hardware : str
230
221
location : str
231
- mode : str
232
222
model : str
233
223
model_id : str
234
224
name : str
@@ -238,17 +228,18 @@ class JipLisaTomData(TypedDict, total=False):
238
228
zigbee_mac_address : str
239
229
240
230
241
- class JipLisaTomSensors (TypedDict , total = False ):
231
+ @dataclass
232
+ class JipLisaTomSensors :
242
233
"""Tom sensors class."""
243
234
244
- battery : int
245
- humidity : int # Jip only
246
- setpoint : float # heat or cool
247
- setpoint_high : float # heat_cool
248
- setpoint_low : float # heat_cool
235
+ battery : int | None # not when AC powered, Lisa/Tom
236
+ humidity : int | None # Jip only
237
+ setpoint : float | None # heat or cool
238
+ setpoint_high : float | None # heat_cool
239
+ setpoint_low : float | None # heat_cool
249
240
temperature : float
250
- temperature_difference : float
251
- valve_position : float
241
+ temperature_difference : float | None # Tom only
242
+ valve_position : float | None # Tom only
252
243
253
244
254
245
@dataclass
@@ -271,17 +262,26 @@ class SetpointDict:
271
262
upper_bound : float
272
263
273
264
274
- class ThermostatDict (TypedDict , total = False ):
265
+ @dataclass
266
+ class ThermostatDict :
275
267
"""Thermostat dict class."""
276
268
277
269
lower_bound : float
278
270
resolution : float
279
- setpoint : float # heat or cool
280
- setpoint_high : float # heat_cool
281
- setpoint_low : float # heat_cool
271
+ setpoint : float | None # heat or cool
272
+ setpoint_high : float | None # heat_cool
273
+ setpoint_low : float | None # heat_cool
282
274
upper_bound : float
283
275
284
276
277
+ @dataclass
278
+ class ThermostatsDict :
279
+ """Thermostats dict class."""
280
+
281
+ primary : list [str ]
282
+ secondary : list [str ]
283
+
284
+
285
285
@dataclass
286
286
class OnOffTherm :
287
287
"""On-off heater/cooler device class."""
@@ -293,68 +293,72 @@ class OnOffTherm:
293
293
name : str
294
294
295
295
296
- class OpenTherm (TypedDict , total = False ):
296
+ @dataclass
297
+ class OpenTherm :
297
298
"""OpenTherm heater/cooler device class."""
298
299
299
300
available : str
300
301
binary_sensors : HeaterCentralBinarySensors
301
302
dev_class : str
302
303
location : str
303
- maximum_boiler_temperature : SetpointDict
304
- max_dhw_temperature : SetpointDict
304
+ maximum_boiler_temperature : SetpointDict | None
305
+ max_dhw_temperature : SetpointDict | None
305
306
model : str
306
- model_id : str
307
+ model_id : str | None
307
308
name : str
308
309
sensors : HeaterCentralSensors
309
310
switches : HeaterCentralSwitches
310
311
vendor : str
311
312
312
313
313
- class HeaterCentralBinarySensors (TypedDict , total = False ):
314
+ @dataclass
315
+ class HeaterCentralBinarySensors :
314
316
"""Heater-central binary_sensors class."""
315
317
316
- compressor_state : bool
317
- cooling_enabled : bool
318
- cooling_state : bool
318
+ compressor_state : bool | None
319
+ cooling_enabled : bool | None
320
+ cooling_state : bool | None
319
321
dhw_state : bool
320
322
flame_state : bool
321
323
heating_state : bool
322
- secondary_boiler_state : bool
324
+ secondary_boiler_state : bool | None
323
325
324
326
325
- class HeaterCentralSensors (TypedDict , total = False ):
327
+ @dataclass
328
+ class HeaterCentralSensors :
326
329
"""Heater-central sensors class."""
327
330
328
- dhw_temperature : float
329
- domestic_hot_water_setpoint : float
330
- intended_boiler_temperature : float
331
- modulation_level : float
332
- outdoor_air_temperature : float
331
+ dhw_temperature : float | None
332
+ domestic_hot_water_setpoint : float | None
333
+ intended_boiler_temperature : float | None
334
+ modulation_level : float | None
335
+ outdoor_air_temperature : float | None
333
336
return_temperature : float
334
- water_pressure : float
337
+ water_pressure : float | None
335
338
water_temperature : float
336
339
337
340
338
- class HeaterCentralSwitches (TypedDict , total = False ):
341
+ @dataclass
342
+ class HeaterCentralSwitches :
339
343
"""Heater-central switches class."""
340
344
341
- cooling_ena_switch : bool
345
+ cooling_ena_switch : bool | None
342
346
dhw_cm_switch : bool
343
347
344
348
345
349
@dataclass
346
350
class PlugData :
347
- """Plug data class."""
351
+ """Plug data class covering Plugwise Adam/Stretch and Aqara Plugs, and generic ZigBee type Switches ."""
348
352
349
- available : bool
353
+ available : bool | None
350
354
dev_class : str
351
- firmware : str
352
- # hardware: str
355
+ firmware : str | None
356
+ hardware : str | None
353
357
location : str
354
- model : str
358
+ model : str | None
355
359
model_id : str
356
360
name : str
357
- sensors : PlugSensors
361
+ sensors : PlugSensors | None
358
362
switches : PlugSwitches
359
363
vendor : str
360
364
zigbee_mac_address : str
@@ -364,29 +368,30 @@ class PlugData:
364
368
class PlugSensors :
365
369
"""Plug sensors class."""
366
370
367
- electricity_consumed : float
371
+ electricity_consumed : float | None
368
372
electricity_consumed_interval : float
369
- electricity_produced : float
370
- electricity_produced_interval : float
373
+ electricity_produced : float | None
374
+ electricity_produced_interval : float | None
371
375
372
376
373
377
@dataclass
374
- class PlugSwitches ( TypedDict , total = False ) :
378
+ class PlugSwitches :
375
379
"""Plug switches class."""
376
380
377
- lock : bool
381
+ lock : bool | None
378
382
relay : bool
379
383
380
384
381
385
class PlugwiseP1 :
382
386
"""Plugwise P1 data class."""
383
387
384
- data : dict [str , SmileP1Gateway | SmartEnergyMeter ]
388
+ data : dict [str , SmileP1Gateway | SmartEnergyMeter | SmartEnergyLegacySensors ]
385
389
386
390
387
391
class Anna (SmileThermostatGateway , AnnaData , OnOffTherm , OpenTherm ):
388
392
"""Plugwise Anna data class."""
389
393
394
+ data : dict [str , SmileThermostatGateway | OnOffTherm | OpenTherm | AnnaData ]
390
395
391
396
class Adam (
392
397
AdamGateway ,
@@ -398,3 +403,11 @@ class Adam(
398
403
OpenTherm ,
399
404
):
400
405
"""Plugwise Anna data class."""
406
+
407
+ data : dict [str , AdamGateway | OnOffTherm | OpenTherm | AnnaAdamData | JipLisaTomData | ThermoZone | PlugData ]
408
+
409
+
410
+ class Stretch :
411
+ """Plugwise Stretch data class."""
412
+
413
+ data : dict [str , StretchGateway | PlugData ]
0 commit comments