mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
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.
This commit is contained in:
parent
b7ad5ff032
commit
3fb323b745
@ -160,13 +160,7 @@ class MaxCubeClimate(ClimateEntity):
|
|||||||
elif hvac_mode == HVAC_MODE_HEAT:
|
elif hvac_mode == HVAC_MODE_HEAT:
|
||||||
temp = max(temp, self.min_temp)
|
temp = max(temp, self.min_temp)
|
||||||
else:
|
else:
|
||||||
# Reset the temperature to a sane value.
|
temp = None
|
||||||
# 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
|
|
||||||
mode = MAX_DEVICE_MODE_AUTOMATIC
|
mode = MAX_DEVICE_MODE_AUTOMATIC
|
||||||
|
|
||||||
cube = self._cubehandle.cube
|
cube = self._cubehandle.cube
|
||||||
@ -264,7 +258,7 @@ class MaxCubeClimate(ClimateEntity):
|
|||||||
def set_preset_mode(self, preset_mode):
|
def set_preset_mode(self, preset_mode):
|
||||||
"""Set new operation mode."""
|
"""Set new operation mode."""
|
||||||
device = self._cubehandle.cube.device_by_rf(self._rf_address)
|
device = self._cubehandle.cube.device_by_rf(self._rf_address)
|
||||||
temp = device.target_temperature
|
temp = None
|
||||||
mode = MAX_DEVICE_MODE_AUTOMATIC
|
mode = MAX_DEVICE_MODE_AUTOMATIC
|
||||||
|
|
||||||
if preset_mode in [PRESET_COMFORT, PRESET_ECO, PRESET_ON]:
|
if preset_mode in [PRESET_COMFORT, PRESET_ECO, PRESET_ON]:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user