Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## v1.14.3-1

- Correct typing of select_schedule, manual fixture update

## v1.14.3

- Change representation of no-thermostat-schedule-defined to a single `off` option via PR [#899](https://github.com/plugwise/python-plugwise/pull/899)
Expand Down
6 changes: 4 additions & 2 deletions fixtures/m_adam_multiple_devices_per_zone/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@
},
"446ac08dd04d4eff8ac57489757b7314": {
"active_preset": "no_frost",
"available_schedules": [],
"available_schedules": [
"off"
],
"climate_mode": "heat",
"control_state": "idle",
"dev_class": "climate",
Expand All @@ -141,7 +143,7 @@
"vacation",
"no_frost"
],
"select_schedule": null,
"select_schedule": "off",
"sensors": {
"temperature": 15.6
},
Expand Down
4 changes: 2 additions & 2 deletions plugwise/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ def __init__(
password,
port,
self._timeout,
username,
websession,
username=username,
websession=websession,
)

self._cooling_present = False
Expand Down
2 changes: 1 addition & 1 deletion plugwise/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ class GwEntityData(TypedDict, total=False):
preset_modes: list[str] | None
# Schedules:
available_schedules: list[str]
select_schedule: str | None
select_schedule: str

climate_mode: str
# Extra for Adam Master Thermostats
Expand Down
1 change: 1 addition & 0 deletions plugwise/smilecomm.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def __init__(
password: str,
port: int,
timeout: int,
*,
username: str,
websession: ClientSession | None,
) -> None:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "plugwise"
version = "1.14.3"
version = "1.14.3-1"
license = "MIT"
description = "Plugwise Smile (Adam/Anna/P1) and Stretch module for Python 3."
readme = "README.md"
Expand Down
4 changes: 2 additions & 2 deletions scripts/manual_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ def json_writer(manual_name: str, output: dict) -> None:
# Change schedule to not present for "446ac08dd04d4eff8ac57489757b7314"
adam_multiple_devices_per_zone["446ac08dd04d4eff8ac57489757b7314"][
"available_schedules"
] = []
] = ["off"]
adam_multiple_devices_per_zone["446ac08dd04d4eff8ac57489757b7314"][
"select_schedule"
] = None
] = "off"

json_writer("m_adam_multiple_devices_per_zone", adam_multiple_devices_per_zone)

Expand Down
25 changes: 21 additions & 4 deletions tests/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ async def connect(
broken=False,
fail_auth=False,
raise_timeout=False,
*,
smile_timeout_value=10,
stretch=False,
timeout_happened=False,
Expand Down Expand Up @@ -728,7 +729,7 @@ async def tinker_thermostat_preset(self, api, loc_id, unhappy=False):

@pytest.mark.asyncio
async def tinker_thermostat_schedule(
self, api, loc_id, state, good_schedules=None, single=False, unhappy=False
self, api, loc_id, state, *, good_schedules=None, single=False, unhappy=False
):
"""Toggle schedules to test functionality."""
# pragma warning disable S3776
Expand Down Expand Up @@ -798,6 +799,7 @@ async def tinker_thermostat(
self,
api,
loc_id,
*,
schedule_on=True,
good_schedules=None,
single=False,
Expand All @@ -817,14 +819,29 @@ async def tinker_thermostat(
for item in api._schedule_old_states[loc_id]:
api._schedule_old_states[loc_id][item] = "off"
result_3 = await self.tinker_thermostat_schedule(
api, loc_id, "on", good_schedules, single, unhappy
api,
loc_id,
"on",
good_schedules=good_schedules,
single=single,
unhappy=unhappy,
)
if schedule_on:
result_4 = await self.tinker_thermostat_schedule(
api, loc_id, "off", good_schedules, single, unhappy
api,
loc_id,
"off",
good_schedules=good_schedules,
single=single,
unhappy=unhappy,
)
result_5 = await self.tinker_thermostat_schedule(
api, loc_id, "on", good_schedules, single, unhappy
api,
loc_id,
"on",
good_schedules=good_schedules,
single=single,
unhappy=unhappy,
)
return result_1 and result_2 and result_3 and result_4 and result_5
return result_1 and result_2 and result_3
Expand Down