Skip to content

Commit b7eeeda

Browse files
committed
Move solution to pw-beta #280 into backend
1 parent d414f88 commit b7eeeda

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

plugwise/smile.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,9 +483,15 @@ async def _set_schedule_state_legacy(self, name: str, status: str) -> None:
483483
await self._request(uri, method="put", data=data)
484484

485485
async def set_schedule_state(self, loc_id: str, name: str, state: str) -> None:
486-
"""Set the Schedule, with the given name, on the relevant Thermostat.
486+
"""Activate/deactivate the Schedule, with the given name, on the relevant Thermostat.
487487
Determined from - DOMAIN_OBJECTS.
488+
In HA Core used to set the hvac_mode: in practice switch between schedule on - off.
488489
"""
490+
# Do nothing when name == None, meaning no schedule to activate / deactivate
491+
# Also, don't through a error, as do nothing is the correct action in this scenario.
492+
if name is None:
493+
return
494+
489495
if self._smile_legacy:
490496
await self._set_schedule_state_legacy(name, state)
491497
return

0 commit comments

Comments
 (0)