From fc3fbf7e41eab7ee7ec4e3453fe961ce3615b036 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Tue, 28 Apr 2020 21:12:16 +0200 Subject: [PATCH 1/2] Fix sync call in async context generic_thermostat --- homeassistant/components/generic_thermostat/climate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/generic_thermostat/climate.py b/homeassistant/components/generic_thermostat/climate.py index 396d347c3c9dbb..3ba406f222fe77 100644 --- a/homeassistant/components/generic_thermostat/climate.py +++ b/homeassistant/components/generic_thermostat/climate.py @@ -325,7 +325,7 @@ async def async_set_hvac_mode(self, hvac_mode): _LOGGER.error("Unrecognized hvac mode: %s", hvac_mode) return # Ensure we update the current operation after changing the mode - self.schedule_update_ha_state() + self.async_schedule_update_ha_state() async def async_set_temperature(self, **kwargs): """Set new target temperature.""" From bd54356c0bb2d0312c11e545fa19e9e07099cd4c Mon Sep 17 00:00:00 2001 From: Martin Hjelmare Date: Wed, 29 Apr 2020 01:56:40 +0200 Subject: [PATCH 2/2] Apply suggestions from code review --- homeassistant/components/generic_thermostat/climate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/generic_thermostat/climate.py b/homeassistant/components/generic_thermostat/climate.py index 3ba406f222fe77..d7889513402863 100644 --- a/homeassistant/components/generic_thermostat/climate.py +++ b/homeassistant/components/generic_thermostat/climate.py @@ -325,7 +325,7 @@ async def async_set_hvac_mode(self, hvac_mode): _LOGGER.error("Unrecognized hvac mode: %s", hvac_mode) return # Ensure we update the current operation after changing the mode - self.async_schedule_update_ha_state() + self.async_write_ha_state() async def async_set_temperature(self, **kwargs): """Set new target temperature."""