Skip to content

Commit 66e3ab2

Browse files
committed
Set cooling_enabled binary_sensor for Loria/Thermastage too
1 parent 6c4339c commit 66e3ab2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

plugwise/helper.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -798,6 +798,8 @@ def _update_elga_cooling(self, data: GwEntityData) -> None:
798798
# Techneco Elga has cooling-capability
799799
self._cooling_present = True
800800
data["model"] = "Generic heater/cooler"
801+
# Cooling_enabled in xml does NOT show the correct status!
802+
# Setting it specifically:
801803
self._cooling_enabled = data["binary_sensors"]["cooling_enabled"] = data["elga_status_code"] in (8, 9)
802804
data["binary_sensors"]["cooling_state"] = self._cooling_active = (
803805
data["elga_status_code"] == 8
@@ -812,11 +814,13 @@ def _update_elga_cooling(self, data: GwEntityData) -> None:
812814

813815
def _update_loria_cooling(self, data: GwEntityData) -> None:
814816
"""Loria/Thermastage: base cooling-related on cooling_state and modulation_level."""
815-
self._cooling_enabled = data["binary_sensors"]["cooling_state"]
817+
# For Loria/Thermastage it's not clear if cooling_enabled in xml shows the correct status,
818+
# setting it specifically:
819+
self._cooling_enabled = data["binary_sensors"]["cooling_enabled"] = data["binary_sensors"]["cooling_state"]
816820
self._cooling_active = data["sensors"]["modulation_level"] == 100
817821
# For Loria the above does not work (pw-beta issue #301)
818822
if "cooling_ena_switch" in data["switches"]:
819-
self._cooling_enabled = data["switches"]["cooling_ena_switch"]
823+
self._cooling_enabled = data["binary_sensors"]["cooling_enabled"] = data["switches"]["cooling_ena_switch"]
820824
self._cooling_active = data["binary_sensors"]["cooling_state"]
821825

822826
def _cleanup_data(self, data: GwEntityData) -> None:

0 commit comments

Comments
 (0)