Skip to content

Commit e91a3bb

Browse files
committed
More updates
1 parent 3e05a55 commit e91a3bb

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

plugwise/data.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -330,18 +330,14 @@ def _get_schedule_states_with_off(
330330
331331
Also, replace NONE by OFF when none of the schedules are active.
332332
"""
333-
loc_schedule_states: dict[str, str] = {}
333+
self._schedule_old_states[location] = {}
334334
for schedule in schedules:
335-
loc_schedule_states[schedule] = "off"
336-
if schedule == selected and data["climate_mode"] == "auto":
337-
loc_schedule_states[schedule] = "on"
338-
339-
self._schedule_old_states[location] = loc_schedule_states
335+
self._schedule_old_states[location][schedule] = "on" if schedule == selected and data["climate_mode"] == "auto" else "off"
340336

341337
all_off = True
342338
for state in self._schedule_old_states[location].values():
343339
if state == "on":
344340
all_off = False
345-
341+
break
346342
if all_off:
347343
data["select_schedule"] = OFF

0 commit comments

Comments
 (0)