Skip to content

Commit 78d13df

Browse files
committed
Move removal of setpoint
1 parent 94a10fe commit 78d13df

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

plugwise/data.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,6 @@ def _get_location_data(self, loc_id: str) -> GwEntityData:
168168
data["control_state"] = "idle"
169169
self._count += 1
170170

171-
data["sensors"].pop("setpoint") # remove, only used in _control_state()
172-
self._count -= 1
173-
174171
# Thermostat data (presets, temperatures etc)
175172
self._climate_data(loc_id, zone, data)
176173

plugwise/helper.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -940,6 +940,9 @@ def _control_state(self, data: GwEntityData, loc_id: str) -> str | bool:
940940
# Work around this by comparing the reported temperature and setpoint for a location
941941
setpoint = data["sensors"]["setpoint"]
942942
temperature = data["sensors"]["temperature"]
943+
data["sensors"].pop("setpoint") # remove, only used here
944+
self._count -= 1
945+
943946
# No cooling available in older firmware
944947
return "heating" if temperature < setpoint else "off"
945948

0 commit comments

Comments
 (0)