diff --git a/CHANGELOG.md b/CHANGELOG.md index bbed6202d..97ddcd023 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/plugwise/legacy/smile.py b/plugwise/legacy/smile.py index 116c15571..42c35ad5a 100644 --- a/plugwise/legacy/smile.py +++ b/plugwise/legacy/smile.py @@ -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" diff --git a/pyproject.toml b/pyproject.toml index e79fbdb91..2f86b9be1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" diff --git a/tests/test_init.py b/tests/test_init.py index 2eae32a63..a7c7d8f14 100644 --- a/tests/test_init.py +++ b/tests/test_init.py @@ -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.""" @@ -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: