Skip to content

Commit 1fb658c

Browse files
committed
Improve Adam control_state-related
1 parent f15e9a8 commit 1fb658c

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

plugwise/data.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,14 @@ def _get_location_data(self, loc_id: str) -> GwEntityData:
167167
"""
168168
zone = self._zones[loc_id]
169169
data = self._get_zone_data(loc_id)
170-
if ctrl_state := self._control_state(data, loc_id):
171-
if str(ctrl_state) in ("cooling", "heating", "preheating"):
172-
data["control_state"] = str(ctrl_state)
173-
self._count += 1
174-
if str(ctrl_state) == "off":
175-
data["control_state"] = "idle"
176-
self._count += 1
170+
data["control_state"] = "idle"
171+
self._count += 1
172+
if (ctrl_state := self._control_state(data, loc_id)) and str(ctrl_state) in (
173+
"cooling",
174+
"heating",
175+
"preheating",
176+
):
177+
data["control_state"] = str(ctrl_state)
177178

178179
data["sensors"].pop("setpoint") # remove, only used in _control_state()
179180
self._count -= 1

0 commit comments

Comments
 (0)