Move program_mode check (#31501)

Don't try to capture program_mode unless ct80
pull/31506/head
Andrew 2020-02-05 16:44:44 -06:00 committed by GitHub
parent ba9892e1f1
commit c9be201ee2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -290,6 +290,8 @@ class RadioThermostat(ClimateDevice):
)
return
self._current_humidity = humiditydata
self._program_mode = data["program_mode"]
self._preset_mode = CODE_TO_PRESET_MODE[data["program_mode"]]
# Map thermostat values into various STATE_ flags.
self._current_temperature = current_temp
@ -297,8 +299,6 @@ class RadioThermostat(ClimateDevice):
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._program_mode = data["program_mode"]
self._preset_mode = CODE_TO_PRESET_MODE[data["program_mode"]]
self._current_operation = self._tmode
if self._tmode == HVAC_MODE_COOL: