From 208a44e437e836fdc36292203fd4348f9fa7c331 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Thu, 13 Apr 2023 09:42:12 +0200 Subject: [PATCH] Use async_write_ha_state in generic hygrostat (#91331) --- .../components/generic_hygrostat/humidifier.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/generic_hygrostat/humidifier.py b/homeassistant/components/generic_hygrostat/humidifier.py index 73d876b354f..c1ebc948b94 100644 --- a/homeassistant/components/generic_hygrostat/humidifier.py +++ b/homeassistant/components/generic_hygrostat/humidifier.py @@ -270,7 +270,7 @@ class GenericHygrostat(HumidifierEntity, RestoreEntity): return self._state = True await self._async_operate(force=True) - await self.async_update_ha_state() + self.async_write_ha_state() async def async_turn_off(self, **kwargs): """Turn hygrostat off.""" @@ -279,7 +279,7 @@ class GenericHygrostat(HumidifierEntity, RestoreEntity): self._state = False if self._is_device_active: await self._async_device_turn_off() - await self.async_update_ha_state() + self.async_write_ha_state() async def async_set_humidity(self, humidity: int) -> None: """Set new target humidity.""" @@ -288,12 +288,12 @@ class GenericHygrostat(HumidifierEntity, RestoreEntity): if self._is_away and self._away_fixed: self._saved_target_humidity = humidity - await self.async_update_ha_state() + self.async_write_ha_state() return self._target_humidity = humidity await self._async_operate() - await self.async_update_ha_state() + self.async_write_ha_state() @property def min_humidity(self): @@ -329,7 +329,7 @@ class GenericHygrostat(HumidifierEntity, RestoreEntity): await self._async_update_humidity(new_state.state) await self._async_operate() - await self.async_update_ha_state() + self.async_write_ha_state() async def _async_sensor_not_responding(self, now=None): """Handle sensor stale event.""" @@ -471,4 +471,4 @@ class GenericHygrostat(HumidifierEntity, RestoreEntity): ) await self._async_operate(force=True) - await self.async_update_ha_state() + self.async_write_ha_state()