Skip to content

Commit ada46e6

Browse files
committed
Improve
1 parent a5543cd commit ada46e6

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

plugwise/data.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -330,15 +330,14 @@ def _get_schedule_states_with_off(
330330
331331
Also, replace NONE by OFF when none of the schedules are active.
332332
"""
333+
all_off = True
333334
self._schedule_old_states[location] = {}
334335
for schedule in schedules:
335336
active: bool = schedule == selected and data["climate_mode"] == "auto"
336-
self._schedule_old_states[location][schedule] = "on" if active else "off"
337-
338-
all_off = True
339-
for state in self._schedule_old_states[location].values():
340-
if state == "on":
337+
self._schedule_old_states[location][schedule] = "off"
338+
if active:
339+
self._schedule_old_states[location][schedule] = "on"
341340
all_off = False
342-
break
341+
343342
if all_off:
344343
data["select_schedule"] = OFF

0 commit comments

Comments
 (0)