Skip to content

Commit b3dbb25

Browse files
committed
Start defining and adding various device-classes
1 parent 40d4af0 commit b3dbb25

File tree

1 file changed

+115
-0
lines changed

1 file changed

+115
-0
lines changed

plugwise/devices.py

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
"""Plugwise Device classes."""
2+
from __future__ import annotations
3+
4+
from dataclasses import dataclass
5+
from typing import TypedDict
6+
7+
8+
@dataclass
9+
class AnnaData:
10+
"""Plugwise Anna data."""
11+
12+
active_preset: str
13+
available_schedules: list[str]
14+
dev_class: str
15+
firmware: str
16+
hardware: str
17+
location: str
18+
mode: str
19+
model: str
20+
model_id: str
21+
name: str
22+
preset_modes: list[str]
23+
select_schedule: str
24+
sensors: AnnaSensor
25+
temperature_offset: SetpointDict
26+
thermostat: ThermostatDict
27+
vendor: str
28+
29+
30+
class AnnaSensors(TypedDict, total=False):
31+
"""Anna sensors class."""
32+
33+
illuminance: float
34+
setpoint: float
35+
setpoint_high: float
36+
setpoint_low: float
37+
temperature: float
38+
39+
40+
@dataclass
41+
class SetpointDict:
42+
"""Generic setpoint dict.
43+
44+
Used for temperature_offset, max_dhw_temperature,maximum_boiler_temperature.
45+
"""
46+
47+
lower_bound: float
48+
resolution: float
49+
setpoint: float
50+
upper_bound: float
51+
52+
53+
class ThermostatDict(TypedDict, total=False):
54+
"""Thermostat dict class."""
55+
56+
lower_bound: float
57+
resolution: float
58+
setpoint: float
59+
setpoint_high: float
60+
setpoint_low: float
61+
upper_bound: float
62+
63+
64+
class OnOffTherm(TypedDict, total=False):
65+
"""On-off heater/cooler device class."""
66+
67+
binary_sensors: HeaterCentralBinarySensors
68+
dev_class: str
69+
location: str
70+
model: str
71+
name: str
72+
73+
74+
class OpenTherm(TypedDict, total=False):
75+
"""OpenTherm heater/cooler device class."""
76+
77+
available: str
78+
binary_sensors: HeaterCentralBinarySensors
79+
dev_class: str
80+
location: str
81+
max_dhw_temperature: SetpointDict
82+
maximum_boiler_temperature: SetpointDict
83+
model: str
84+
model_id: str
85+
name: str
86+
sensors: HeaterCentralSensors
87+
switches: HeaterCentralSwitches
88+
vendor : str
89+
90+
91+
class HeaterCentralBinarySensors(TypedDict, total=False):
92+
"""Heater-central binary_sensors class."""
93+
94+
cooling_state: bool
95+
dhw_state: bool
96+
flame_state: bool
97+
heating_state: bool
98+
99+
100+
class HeaterCentralSensors(TypedDict, total=False):
101+
"""Heater-central sensors class."""
102+
103+
dhw_temperature: float
104+
intended_boiler_temperature: float
105+
modulation_level: float
106+
outdoor_air_temperature: float
107+
return_temperature: float
108+
water_pressure: float
109+
water_temperature: float
110+
111+
112+
class HeaterCentralSwitches(TypedDict, total=False):
113+
"""Heater-central switches class."""
114+
115+
dhw_cm_switch: bool

0 commit comments

Comments
 (0)