Fix Radiothermostat hold value updates (#53656)

This commit is contained in:
Vinny Furia 2021-08-02 06:57:10 -06:00 committed by GitHub
parent 0f8a286cc7
commit 4f8c799610
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -80,6 +80,8 @@ PRESET_MODE_TO_CODE = {"home": 0, "alternate": 1, "away": 2, "holiday": 3}
CODE_TO_PRESET_MODE = {0: "home", 1: "alternate", 2: "away", 3: "holiday"}
CODE_TO_HOLD_STATE = {0: False, 1: True}
def round_temp(temperature):
"""Round a temperature to the resolution of the thermostat.
@ -300,6 +302,7 @@ class RadioThermostat(ClimateEntity):
self._fstate = CODE_TO_FAN_STATE[data["fstate"]]
self._tmode = CODE_TO_TEMP_MODE[data["tmode"]]
self._tstate = CODE_TO_TEMP_STATE[data["tstate"]]
self._hold_set = CODE_TO_HOLD_STATE[data["hold"]]
self._current_operation = self._tmode
if self._tmode == HVAC_MODE_COOL: