Skip to content

Commit 546ddb1

Browse files
authored
Merge pull request #911 from plugwise/select_schedule_2
Fix missed in v1.14.3
2 parents 8b41c85 + ece9660 commit 546ddb1

8 files changed

Lines changed: 36 additions & 12 deletions

File tree

CHANGELOG.md

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

3+
## v1.14.3-1
4+
5+
- Correct typing of select_schedule, manual fixture update
6+
37
## v1.14.3
48

59
- Change representation of no-thermostat-schedule-defined to a single `off` option via PR [#899](https://github.com/plugwise/python-plugwise/pull/899)

fixtures/m_adam_multiple_devices_per_zone/data.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,9 @@
128128
},
129129
"446ac08dd04d4eff8ac57489757b7314": {
130130
"active_preset": "no_frost",
131-
"available_schedules": [],
131+
"available_schedules": [
132+
"off"
133+
],
132134
"climate_mode": "heat",
133135
"control_state": "idle",
134136
"dev_class": "climate",
@@ -141,7 +143,7 @@
141143
"vacation",
142144
"no_frost"
143145
],
144-
"select_schedule": null,
146+
"select_schedule": "off",
145147
"sensors": {
146148
"temperature": 15.6
147149
},

plugwise/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ def __init__(
6060
password,
6161
port,
6262
self._timeout,
63-
username,
64-
websession,
63+
username=username,
64+
websession=websession,
6565
)
6666

6767
self._cooling_present = False

plugwise/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ class GwEntityData(TypedDict, total=False):
584584
preset_modes: list[str] | None
585585
# Schedules:
586586
available_schedules: list[str]
587-
select_schedule: str | None
587+
select_schedule: str
588588

589589
climate_mode: str
590590
# Extra for Adam Master Thermostats

plugwise/smilecomm.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ def __init__(
3434
password: str,
3535
port: int,
3636
timeout: int,
37+
*,
3738
username: str,
3839
websession: ClientSession | None,
3940
) -> None:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "plugwise"
7-
version = "1.14.3"
7+
version = "1.14.3-1"
88
license = "MIT"
99
description = "Plugwise Smile (Adam/Anna/P1) and Stretch module for Python 3."
1010
readme = "README.md"

scripts/manual_fixtures.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ def json_writer(manual_name: str, output: dict) -> None:
3838
# Change schedule to not present for "446ac08dd04d4eff8ac57489757b7314"
3939
adam_multiple_devices_per_zone["446ac08dd04d4eff8ac57489757b7314"][
4040
"available_schedules"
41-
] = []
41+
] = ["off"]
4242
adam_multiple_devices_per_zone["446ac08dd04d4eff8ac57489757b7314"][
4343
"select_schedule"
44-
] = None
44+
] = "off"
4545

4646
json_writer("m_adam_multiple_devices_per_zone", adam_multiple_devices_per_zone)
4747

tests/test_init.py

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ async def connect(
283283
broken=False,
284284
fail_auth=False,
285285
raise_timeout=False,
286+
*,
286287
smile_timeout_value=10,
287288
stretch=False,
288289
timeout_happened=False,
@@ -728,7 +729,7 @@ async def tinker_thermostat_preset(self, api, loc_id, unhappy=False):
728729

729730
@pytest.mark.asyncio
730731
async def tinker_thermostat_schedule(
731-
self, api, loc_id, state, good_schedules=None, single=False, unhappy=False
732+
self, api, loc_id, state, *, good_schedules=None, single=False, unhappy=False
732733
):
733734
"""Toggle schedules to test functionality."""
734735
# pragma warning disable S3776
@@ -798,6 +799,7 @@ async def tinker_thermostat(
798799
self,
799800
api,
800801
loc_id,
802+
*,
801803
schedule_on=True,
802804
good_schedules=None,
803805
single=False,
@@ -817,14 +819,29 @@ async def tinker_thermostat(
817819
for item in api._schedule_old_states[loc_id]:
818820
api._schedule_old_states[loc_id][item] = "off"
819821
result_3 = await self.tinker_thermostat_schedule(
820-
api, loc_id, "on", good_schedules, single, unhappy
822+
api,
823+
loc_id,
824+
"on",
825+
good_schedules=good_schedules,
826+
single=single,
827+
unhappy=unhappy,
821828
)
822829
if schedule_on:
823830
result_4 = await self.tinker_thermostat_schedule(
824-
api, loc_id, "off", good_schedules, single, unhappy
831+
api,
832+
loc_id,
833+
"off",
834+
good_schedules=good_schedules,
835+
single=single,
836+
unhappy=unhappy,
825837
)
826838
result_5 = await self.tinker_thermostat_schedule(
827-
api, loc_id, "on", good_schedules, single, unhappy
839+
api,
840+
loc_id,
841+
"on",
842+
good_schedules=good_schedules,
843+
single=single,
844+
unhappy=unhappy,
828845
)
829846
return result_1 and result_2 and result_3 and result_4 and result_5
830847
return result_1 and result_2 and result_3

0 commit comments

Comments
 (0)