Skip to content

Commit cf13048

Browse files
authored
Merge pull request #189 from plugwise/alt_fix_pw_beta_280
Move solution to pw-beta #280 into backend
2 parents d414f88 + 7e799c3 commit cf13048

File tree

4 files changed

+106
-44
lines changed

4 files changed

+106
-44
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Changelog
22

3+
# v0.18.3: Smile: move solution for pw-beta #280 into backend
4+
35
# v0.18.2: Smile: fix for https://github.com/plugwise/python-plugwise/issues/187
46

57
# v0.18.1: Smile Adam: don't show vacation-preset, as not shown in the Plugwise App or on the local Adam-website

plugwise/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Plugwise module."""
22

3-
__version__ = "0.18.2"
3+
__version__ = "0.18.3"
44

55
from plugwise.smile import Smile
66
from plugwise.stick import Stick

plugwise/smile.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -482,10 +482,18 @@ async def _set_schedule_state_legacy(self, name: str, status: str) -> None:
482482

483483
await self._request(uri, method="put", data=data)
484484

485-
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.
485+
async def set_schedule_state(
486+
self, loc_id: str, name: str | None, state: str
487+
) -> None:
488+
"""Activate/deactivate the Schedule, with the given name, on the relevant Thermostat.
487489
Determined from - DOMAIN_OBJECTS.
490+
In HA Core used to set the hvac_mode: in practice switch between schedule on - off.
488491
"""
492+
# Do nothing when name == None, meaning no schedule to activate / deactivate
493+
# Also, don't show an error, as doing nothing is the correct action in this scenario.
494+
if name is None:
495+
return
496+
489497
if self._smile_legacy:
490498
await self._set_schedule_state_legacy(name, state)
491499
return

0 commit comments

Comments
 (0)