File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed
Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments