From 3fb323b745f2d075fa6405b151c0afe142afe706 Mon Sep 17 00:00:00 2001 From: unaiur Date: Mon, 22 Mar 2021 13:13:06 +0100 Subject: [PATCH] Fix maxcube temperature for thermostat auto mode (#48047) maxcube-api dependency now supports using None as the target temperature: in that case, it uses the scheduled temperature in auto mode and current temperature in all other modes. We will use that feature when changing hvac_mode to auto and selecting PRESET_NONE. --- homeassistant/components/maxcube/climate.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/homeassistant/components/maxcube/climate.py b/homeassistant/components/maxcube/climate.py index 87da5953f26..7c114a927d6 100644 --- a/homeassistant/components/maxcube/climate.py +++ b/homeassistant/components/maxcube/climate.py @@ -160,13 +160,7 @@ class MaxCubeClimate(ClimateEntity): elif hvac_mode == HVAC_MODE_HEAT: temp = max(temp, self.min_temp) else: - # Reset the temperature to a sane value. - # Ideally, we should send 0 and the device will set its - # temperature according to the schedule. However, current - # version of the library has a bug which causes an - # exception when setting values below 8. - if temp in [OFF_TEMPERATURE, ON_TEMPERATURE]: - temp = device.eco_temperature + temp = None mode = MAX_DEVICE_MODE_AUTOMATIC cube = self._cubehandle.cube @@ -264,7 +258,7 @@ class MaxCubeClimate(ClimateEntity): def set_preset_mode(self, preset_mode): """Set new operation mode.""" device = self._cubehandle.cube.device_by_rf(self._rf_address) - temp = device.target_temperature + temp = None mode = MAX_DEVICE_MODE_AUTOMATIC if preset_mode in [PRESET_COMFORT, PRESET_ECO, PRESET_ON]: