From 0996c82c028532c3dc891bb84ee910366395360a Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk <11290930+bouwew@users.noreply.github.com> Date: Wed, 22 Nov 2023 13:20:33 +0100 Subject: [PATCH] Plugwise: limit _attr_max_temp to 35.0 for thermostats that report a max of 100. (#104324) --- homeassistant/components/plugwise/climate.py | 2 +- tests/components/plugwise/test_climate.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/plugwise/climate.py b/homeassistant/components/plugwise/climate.py index a33cef0e3a7..42004ce7088 100644 --- a/homeassistant/components/plugwise/climate.py +++ b/homeassistant/components/plugwise/climate.py @@ -67,7 +67,7 @@ class PlugwiseClimateEntity(PlugwiseEntity, ClimateEntity): self._attr_preset_modes = presets self._attr_min_temp = self.device["thermostat"]["lower_bound"] - self._attr_max_temp = self.device["thermostat"]["upper_bound"] + self._attr_max_temp = min(self.device["thermostat"]["upper_bound"], 35.0) # Ensure we don't drop below 0.1 self._attr_target_temperature_step = max( self.device["thermostat"]["resolution"], 0.1 diff --git a/tests/components/plugwise/test_climate.py b/tests/components/plugwise/test_climate.py index d8ce2785f2a..2d9885637df 100644 --- a/tests/components/plugwise/test_climate.py +++ b/tests/components/plugwise/test_climate.py @@ -33,7 +33,7 @@ async def test_adam_climate_entity_attributes( assert state.attributes["supported_features"] == 17 assert state.attributes["temperature"] == 21.5 assert state.attributes["min_temp"] == 0.0 - assert state.attributes["max_temp"] == 99.9 + assert state.attributes["max_temp"] == 35.0 assert state.attributes["target_temp_step"] == 0.1 state = hass.states.get("climate.zone_thermostat_jessie") @@ -50,7 +50,7 @@ async def test_adam_climate_entity_attributes( assert state.attributes["preset_mode"] == "asleep" assert state.attributes["temperature"] == 15.0 assert state.attributes["min_temp"] == 0.0 - assert state.attributes["max_temp"] == 99.9 + assert state.attributes["max_temp"] == 35.0 assert state.attributes["target_temp_step"] == 0.1