From 42d4e496a3e51dc9a302b08ea4bcf057d6c105a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Seux?= Date: Sat, 14 Sep 2024 16:20:28 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Disable=20temperature=20set=20fo?= =?UTF-8?q?r=20pumps=20in=20thermostat=20mode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Relates to #250 --- custom_components/aquarea/climate.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/custom_components/aquarea/climate.py b/custom_components/aquarea/climate.py index 1b9504a..f9e22da 100644 --- a/custom_components/aquarea/climate.py +++ b/custom_components/aquarea/climate.py @@ -259,6 +259,9 @@ async def async_set_temperature(self, **kwargs) -> None: _LOGGER.info( f"{self._climate_type()} Changing {self.name} target room temperature to {temperature} for zone {self.zone_id}" ) + elif self._mode == ZoneTemperatureMode.NAN: + _LOGGER.warn(f"{self._climate_type()} Changing {self.name} target temperature is not allowed for zone {self.zone_id} (external thermostat)") + return else: raise Exception(f"Unknown climate mode: {self._mode}") payload = str(temperature) @@ -289,6 +292,8 @@ async def async_added_to_hass(self) -> None: self._climate_mode = ZoneClimateMode(stored_values["zone_climate_mode"]) self._mode = ZoneTemperatureMode(stored_values["zone_temperature_mode"]) self.change_mode(self._mode) + if self._mode == ZoneTemperatureMode.NAN: + self._attr_supported_features = ClimateEntityFeature.TURN_OFF | ClimateEntityFeature.TURN_ON else: self.change_mode(ZoneTemperatureMode.DIRECT, initialization=True)