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

## v0.37.3

- Fix for [plugwise-beta #620](https://github.com/plugwise/plugwise-beta/issues/620)

## v0.37.2

- Code improvements
Expand Down
6 changes: 5 additions & 1 deletion plugwise/legacy/smile.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,12 @@ async def _set_groupswitch_member_state(

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

async def set_temperature(self, setpoint: str, _: dict[str, float]) -> None:
async def set_temperature(self, _: str, items: dict[str, float]) -> None:
"""Set the given Temperature on the relevant Thermostat."""
setpoint: float | None = None
if "setpoint" in items:
setpoint = items["setpoint"]

if setpoint is None:
raise PlugwiseError(
"Plugwise: failed setting temperature: no valid input provided"
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 = "0.37.2"
version = "0.37.3"
license = {file = "LICENSE"}
description = "Plugwise Smile (Adam/Anna/P1) and Stretch module for Python 3."
readme = "README.md"
Expand Down
36 changes: 10 additions & 26 deletions tests/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -686,30 +686,6 @@ async def tinker_thermostat_temp(

return tinker_temp_passed

@pytest.mark.asyncio
async def tinker_legacy_thermostat_temp(self, smile, unhappy=False):
"""Toggle temperature to test functionality."""
_LOGGER.info("Assert modifying temperature setpoint")
tinker_temp_passed = False
test_temp = 22.9
_LOGGER.info("- Adjusting temperature to %s", test_temp)
try:
await smile.set_temperature(test_temp, None)
_LOGGER.info(" + worked as intended")
tinker_temp_passed = True
except (
pw_exceptions.ErrorSendingCommandError,
pw_exceptions.ResponseError,
):
if unhappy:
_LOGGER.info(" + failed as expected")
tinker_temp_passed = True
else: # pragma: no cover
_LOGGER.info(" - failed unexpectedly")
tinker_temp_passed = False

return tinker_temp_passed

@pytest.mark.asyncio
async def tinker_thermostat_preset(self, smile, loc_id, unhappy=False):
"""Toggle preset to test functionality."""
Expand Down Expand Up @@ -843,9 +819,17 @@ async def tinker_thermostat(
return result_1 and result_2 and result_3

@pytest.mark.asyncio
async def tinker_legacy_thermostat(self, smile, schedule_on=True, unhappy=False):
async def tinker_legacy_thermostat(
self,
smile,
schedule_on=True,
block_cooling=False,
unhappy=False
):
"""Toggle various climate settings to test functionality."""
result_1 = await self.tinker_legacy_thermostat_temp(smile, unhappy)
result_1 = await self.tinker_thermostat_temp(
smile, "dummy", block_cooling, unhappy
)
result_2 = await self.tinker_thermostat_preset(smile, None, unhappy)
result_3 = await self.tinker_legacy_thermostat_schedule(smile, unhappy)
if schedule_on:
Expand Down