Skip to content

Commit 6f3e609

Browse files
committed
Improve Elga-related logic
1 parent c171931 commit 6f3e609

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

plugwise/helper.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,12 +1029,13 @@ def _get_measurement_data(self, dev_id: str) -> DeviceData:
10291029
# Anna+Elga: base cooling_state on the elga-status-code
10301030
if "elga_status_code" in data:
10311031
# Determine _cooling_present and _cooling_enabled
1032-
if (
1033-
"cooling_enabled" in data["binary_sensors"]
1034-
and data["binary_sensors"]["cooling_enabled"]
1035-
):
1036-
self._cooling_present = self._cooling_enabled = True
1032+
if "cooling_enabled" in data["binary_sensors"]:
1033+
self._cooling_present = True
10371034
data["model"] = "Generic heater/cooler"
1035+
self._cooling_enabled = False
1036+
if data["binary_sensors"]["cooling_enabled"]:
1037+
self._cooling_enabled = True
1038+
10381039
data["binary_sensors"]["cooling_state"] = self._cooling_active = (
10391040
data["elga_status_code"] == 8
10401041
)

0 commit comments

Comments
 (0)