Skip to content

Commit 86ec5b7

Browse files
committed
Sort constants
1 parent b034543 commit 86ec5b7

File tree

1 file changed

+41
-38
lines changed

1 file changed

+41
-38
lines changed

plugwise/constants.py

Lines changed: 41 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -121,21 +121,20 @@
121121
# radiator_valve: 'uncorrected_temperature', 'temperature_offset'
122122

123123
DEVICE_MEASUREMENTS: Final[dict[str, DATA | UOM]] = {
124-
# HA Core thermostat current_temperature
125-
"temperature": UOM(TEMP_CELSIUS),
126-
# HA Core thermostat setpoint
127-
"thermostat": DATA("setpoint", TEMP_CELSIUS),
128-
# Specific for an Anna
129-
"illuminance": UOM(UNIT_LUMEN),
124+
"humidity": UOM(PERCENTAGE), # Specific for a Jip
125+
"illuminance": UOM(UNIT_LUMEN), # Specific for an Anna
126+
"temperature": UOM(TEMP_CELSIUS), # HA Core thermostat current_temperature
127+
"thermostat": DATA("setpoint", TEMP_CELSIUS), # HA Core thermostat setpoint
128+
########################################################
130129
# Specific for an Anna with heatpump extension installed
131130
"cooling_activation_outdoor_temperature": UOM(TEMP_CELSIUS),
132131
"cooling_deactivation_threshold": UOM(TEMP_CELSIUS),
133-
# Specific for a Lisa a Tom/Floor
132+
##################################
133+
# Specific for a Lisa or Tom/Floor
134134
"battery": UOM(PERCENTAGE),
135135
"temperature_difference": UOM(DEGREE),
136136
"valve_position": UOM(PERCENTAGE),
137-
# Specific for a Jip
138-
"humidity": UOM(PERCENTAGE),
137+
#####################
139138
# Specific for a Plug
140139
"electricity_consumed": UOM(POWER_WATT),
141140
"electricity_produced": UOM(POWER_WATT),
@@ -144,39 +143,43 @@
144143

145144
# Heater Central related measurements
146145
HEATER_CENTRAL_MEASUREMENTS: Final[dict[str, DATA | UOM]] = {
146+
"boiler_state": DATA(
147+
"flame_state", NONE
148+
), # Legacy Anna: similar to flame-state on Anna/Adam
147149
"boiler_temperature": DATA("water_temperature", TEMP_CELSIUS),
150+
"central_heating_state": DATA(
151+
"c_heating_state", NONE
152+
), # For Elga (heatpump) use this instead of intended_central_heating_state
153+
"central_heater_water_pressure": DATA("water_pressure", PRESSURE_BAR),
154+
"compressor_state": UOM(NONE), # present with heatpump
155+
"cooling_enabled": UOM(
156+
NONE
157+
), # Available with the Loria and Elga (newer Anna firmware) heatpumps
158+
"cooling_state": UOM(NONE),
148159
"domestic_hot_water_mode": DATA("select_dhw_mode", NONE),
149160
"domestic_hot_water_setpoint": UOM(TEMP_CELSIUS),
150161
"domestic_hot_water_state": DATA("dhw_state", NONE),
151162
"domestic_hot_water_temperature": DATA("dhw_temperature", TEMP_CELSIUS),
152163
"elga_status_code": UOM(NONE),
164+
"intended_boiler_state": DATA(
165+
"heating_state", NONE
166+
), # Legacy Anna: shows when heating is active, we don't show dhw_state, cannot be determined reliably
167+
"flame_state": UOM(
168+
NONE
169+
), # Also present when there is a single gas-heater
153170
"intended_boiler_temperature": UOM(
154171
TEMP_CELSIUS
155172
), # Non-zero when heating, zero when dhw-heating
156-
"central_heating_state": DATA(
157-
"c_heating_state", NONE
158-
), # For Elga (heatpump) use this instead of intended_central_heating_state
159173
"intended_central_heating_state": DATA(
160174
"heating_state", NONE
161175
), # This key shows in general the heating-behavior better than c-h_state. except when connected to a heatpump
162176
"modulation_level": UOM(PERCENTAGE),
163177
"return_water_temperature": DATA("return_temperature", TEMP_CELSIUS),
164-
# Used with the Elga heatpump - marcelveldt
165-
"compressor_state": UOM(NONE),
166-
"cooling_state": UOM(NONE),
167-
"thermostat_supports_cooling": UOM(NONE),
168-
# Available with the Loria and Elga (newer Anna firmware) heatpumps
169-
"cooling_enabled": UOM(NONE),
170-
# Next 2 keys are used to show the state of the gas-heater used next to the Elga heatpump - marcelveldt
178+
"outdoor_temperature": DATA(
179+
"outdoor_air_temperature", TEMP_CELSIUS
180+
), # Outdoor temperature from APPLIANCES - present for a heatpump
171181
"slave_boiler_state": DATA("secondary_boiler_state", NONE),
172-
"flame_state": UOM(NONE), # Also present when there is a single gas-heater
173-
"central_heater_water_pressure": DATA("water_pressure", PRESSURE_BAR),
174-
# Legacy Anna: similar to flame-state on Anna/Adam
175-
"boiler_state": DATA("flame_state", NONE),
176-
# Legacy Anna: shows when heating is active, we don't show dhw_state, cannot be determined reliably
177-
"intended_boiler_state": DATA("heating_state", NONE),
178-
# Outdoor temperature from APPLIANCES - present for a heatpump
179-
"outdoor_temperature": DATA("outdoor_air_temperature", TEMP_CELSIUS),
182+
"thermostat_supports_cooling": UOM(NONE), # present with heatpump
180183
}
181184

182185
OBSOLETE_MEASUREMENTS: Final[tuple[str, ...]] = (
@@ -253,8 +256,8 @@
253256
]
254257

255258
BinarySensorType = Literal[
256-
"cooling_enabled",
257259
"compressor_state",
260+
"cooling_enabled",
258261
"cooling_state",
259262
"dhw_state",
260263
"flame_state",
@@ -265,10 +268,10 @@
265268
BINARY_SENSORS: Final[tuple[str, ...]] = get_args(BinarySensorType)
266269

267270
LIMITS: Final[tuple[str, ...]] = (
271+
"lower_bound",
268272
"offset",
269-
"setpoint",
270273
"resolution",
271-
"lower_bound",
274+
"setpoint",
272275
"upper_bound",
273276
)
274277

@@ -329,8 +332,8 @@
329332

330333
SPECIAL_PLUG_TYPES: Final[tuple[str, ...]] = (
331334
"central_heating_pump",
332-
"valve_actuator",
333335
"heater_electric",
336+
"valve_actuator",
334337
)
335338

336339
SpecialType = Literal[
@@ -350,14 +353,14 @@
350353
]
351354
SWITCHES: Final[tuple[str, ...]] = get_args(SwitchType)
352355

353-
SWITCH_GROUP_TYPES: Final[tuple[str, ...]] = ("switching", "report")
356+
SWITCH_GROUP_TYPES: Final[tuple[str, ...]] = ("report", "switching")
354357

355358
THERMOSTAT_CLASSES: Final[tuple[str, ...]] = (
356359
"thermostat",
360+
"thermostatic_radiator_valve",
357361
"thermo_sensor",
358362
"zone_thermometer",
359363
"zone_thermostat",
360-
"thermostatic_radiator_valve",
361364
)
362365

363366
ToggleNameType = Literal[
@@ -392,19 +395,19 @@ class ModelData(TypedDict):
392395
"""The ModelData class."""
393396

394397
contents: bool
395-
vendor_name: str | None
396-
vendor_model: str | None
397-
hardware_version: str | None
398398
firmware_version: str | None
399-
zigbee_mac_address: str | None
399+
hardware_version: str | None
400400
reachable: bool | None
401+
vendor_model: str | None
402+
vendor_name: str | None
403+
zigbee_mac_address: str | None
401404

402405

403406
class SmileBinarySensors(TypedDict, total=False):
404407
"""Smile Binary Sensors class."""
405408

406-
cooling_enabled: bool
407409
compressor_state: bool
410+
cooling_enabled: bool
408411
cooling_state: bool
409412
dhw_state: bool
410413
flame_state: bool

0 commit comments

Comments
 (0)