1 """DataUpdate Coordinator, and base Entity and Device models for Toon."""
3 from __future__
import annotations
5 from dataclasses
import dataclass
10 from .const
import DOMAIN
11 from .coordinator
import ToonDataUpdateCoordinator
15 """Defines a base Toon entity."""
19 """Defines a Toon display device entity."""
23 """Return device information about this thermostat."""
24 agreement = self.coordinator.data.agreement
26 identifiers={(DOMAIN, agreement.agreement_id)},
28 model=agreement.display_hardware_version.rpartition(
"/")[0],
30 sw_version=agreement.display_software_version.rpartition(
"/")[-1],
35 """Defines a Electricity Meter device entity."""
39 """Return device information about this entity."""
40 agreement_id = self.coordinator.data.agreement.agreement_id
42 name=
"Electricity Meter",
44 (DOMAIN, agreement_id,
"electricity"),
55 """Defines a Gas Meter device entity."""
59 """Return device information about this entity."""
60 agreement_id = self.coordinator.data.agreement.agreement_id
64 (DOMAIN, agreement_id,
"gas"),
75 """Defines a Water Meter device entity."""
79 """Return device information about this entity."""
80 agreement_id = self.coordinator.data.agreement.agreement_id
84 (DOMAIN, agreement_id,
"water"),
95 """Defines a Solar Device device entity."""
99 """Return device information about this entity."""
100 agreement_id = self.coordinator.data.agreement.agreement_id
104 (DOMAIN, agreement_id,
"solar"),
115 """Defines a Boiler Module device entity."""
119 """Return device information about this entity."""
120 agreement_id = self.coordinator.data.agreement.agreement_id
122 name=
"Boiler Module",
123 manufacturer=
"Eneco",
131 via_device=(DOMAIN, agreement_id),
136 """Defines a Boiler device entity."""
140 """Return device information about this entity."""
141 agreement_id = self.coordinator.data.agreement.agreement_id
145 (DOMAIN, agreement_id,
"boiler"),
155 @dataclass(frozen=True)
157 """Mixin for required keys."""
DeviceInfo device_info(self)
DeviceInfo device_info(self)
DeviceInfo device_info(self)
DeviceInfo device_info(self)
DeviceInfo device_info(self)
DeviceInfo device_info(self)
DeviceInfo device_info(self)