Skip to content

Commit 9d73865

Browse files
committed
Try using the added dataclasses
1 parent 7d94d5d commit 9d73865

File tree

1 file changed

+31
-52
lines changed

1 file changed

+31
-52
lines changed

plugwise/constants.py

Lines changed: 31 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,22 @@
66
import logging
77
from typing import Final, Literal, TypedDict, get_args
88

9+
from plugwise.devices import (
10+
AdamGateway,
11+
AnnaAdamData,
12+
AnnaData,
13+
JipLisaTomData,
14+
PlugData,
15+
OnOffTherm,
16+
OpenTherm,
17+
SmartEnergyLegacySensors,
18+
SmartEnergyMeter,
19+
SmileP1Gateway,
20+
SmileThermostatGateway,
21+
StretchGateway,
22+
ThermoZone,
23+
)
24+
925
LOGGER = logging.getLogger(__name__)
1026

1127
# Copied homeassistant.consts
@@ -517,66 +533,29 @@ class ActuatorData(TypedDict, total=False):
517533
upper_bound: float
518534

519535

520-
class GwEntityData(TypedDict, total=False):
536+
class GwEntityData(
537+
AdamGateway,
538+
AnnaAdamData,
539+
AnnaData,
540+
JipLisaTomData,
541+
PlugData,
542+
OnOffTherm,
543+
OpenTherm,
544+
SmartEnergyLegacySensors,
545+
SmartEnergyMeter,
546+
SmileP1Gateway,
547+
SmileThermostatGateway,
548+
StretchGateway,
549+
ThermoZone,
550+
):
521551
"""The Gateway Entity data class.
522552
523553
Covering the collected output-data per device or location.
524554
"""
525555

526-
# Appliance base data
527-
dev_class: str
528-
firmware: str
529-
hardware: str
530-
location: str
531-
mac_address: str
532-
members: list[str]
533-
model: str
534-
model_id: str | None
535-
name: str
536-
vendor: str
537-
zigbee_mac_address: str
538-
539556
# For temporary use
540557
cooling_enabled: bool
541558
domestic_hot_water_setpoint: float
542559
elga_status_code: int
543560
c_heating_state: bool
544561
thermostat_supports_cooling: bool
545-
546-
# Device availability
547-
available: bool | None
548-
549-
# Loria
550-
select_dhw_mode: str
551-
dhw_modes: list[str]
552-
553-
# Gateway
554-
gateway_modes: list[str]
555-
notifications: dict[str, dict[str, str]]
556-
regulation_modes: list[str]
557-
select_gateway_mode: str
558-
select_regulation_mode: str
559-
560-
# Thermostat-related
561-
select_zone_profile: str
562-
thermostats: dict[str, list[str]]
563-
zone_profiles: list[str]
564-
# Presets:
565-
active_preset: str | None
566-
preset_modes: list[str] | None
567-
# Schedules:
568-
available_schedules: list[str]
569-
select_schedule: str | None
570-
571-
climate_mode: str
572-
# Extra for Adam Master Thermostats
573-
control_state: str
574-
575-
# Dict-types
576-
binary_sensors: SmileBinarySensors
577-
max_dhw_temperature: ActuatorData
578-
maximum_boiler_temperature: ActuatorData
579-
sensors: SmileSensors
580-
switches: SmileSwitches
581-
temperature_offset: ActuatorData
582-
thermostat: ActuatorData

0 commit comments

Comments
 (0)