Skip to content

Commit 29fe41c

Browse files
committed
Adam: add cooling_enabled when not in xml-data
1 parent 30d52fa commit 29fe41c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

plugwise/data.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,8 @@ def _get_adam_data(self, entity: GwEntityData, data: GwEntityData) -> None:
225225
"""Helper-function for _get_entity_data().
226226
227227
Determine Adam heating-status for on-off heating via valves,
228-
available regulations_modes and thermostat control_states.
228+
available regulations_modes and thermostat control_states,
229+
and add missing cooling_enabled when required.
229230
"""
230231
if self.smile(ADAM):
231232
# Indicate heating_state based on valves being open in case of city-provided heating
@@ -236,6 +237,11 @@ def _get_adam_data(self, entity: GwEntityData, data: GwEntityData) -> None:
236237
):
237238
data["binary_sensors"]["heating_state"] = self._heating_valves() != 0
238239

240+
# Add cooling_enabled binary_sensor
241+
if entity["dev_class"] == "heater_central" and "binary_sensors" in data:
242+
if "cooling_enabled" not in data["binary_sensors"] and self._cooling_present:
243+
data["binary_sensors"].update({"cooling_enabled": self._cooling_enabled})
244+
239245
# Show the allowed regulation_modes and gateway_modes
240246
if entity["dev_class"] == "gateway":
241247
if self._reg_allowed_modes:
@@ -245,7 +251,6 @@ def _get_adam_data(self, entity: GwEntityData, data: GwEntityData) -> None:
245251
data["gateway_modes"] = self._gw_allowed_modes
246252
self._count += 1
247253

248-
249254
def _climate_data(
250255
self,
251256
location_id: str,

0 commit comments

Comments
 (0)