Fix Netatmo climate boost/heat event handling (#38923)

* Fix boost event handling

* Replace strings with vars
This commit is contained in:
cgtobi 2020-08-16 12:18:58 +02:00 committed by Paulus Schoutsen
parent 5fa14aae7d
commit 79924fcc7a

View File

@ -262,8 +262,11 @@ class NetatmoThermostat(NetatmoBase, ClimateEntity):
for room in home["rooms"]:
if data["event_type"] == "set_point":
if self._id == room["id"]:
if room["therm_setpoint_mode"] == "off":
if room["therm_setpoint_mode"] == STATE_NETATMO_OFF:
self._hvac_mode = HVAC_MODE_OFF
elif room["therm_setpoint_mode"] == STATE_NETATMO_MAX:
self._hvac_mode = HVAC_MODE_HEAT
self._target_temperature = DEFAULT_MAX_TEMP
else:
self._target_temperature = room["therm_setpoint_temperature"]
self.async_write_ha_state()