From 6b34ba012cffa0ed5430e3e76f8a7c4606c3eb5b Mon Sep 17 00:00:00 2001 From: jan iversen Date: Mon, 17 May 2021 14:20:51 +0200 Subject: [PATCH] Fix missing await in modbus platforms (followup on async PR) (#50710) --- homeassistant/components/modbus/climate.py | 2 +- homeassistant/components/modbus/cover.py | 4 ++-- homeassistant/components/modbus/switch.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/modbus/climate.py b/homeassistant/components/modbus/climate.py index 43c0f0d05db..41843fd4929 100644 --- a/homeassistant/components/modbus/climate.py +++ b/homeassistant/components/modbus/climate.py @@ -213,7 +213,7 @@ class ModbusThermostat(ClimateEntity): self._target_temperature_register, register_value, ) - self.async_update() + await self.async_update() @property def available(self) -> bool: diff --git a/homeassistant/components/modbus/cover.py b/homeassistant/components/modbus/cover.py index 48dc08a18b9..bfe4ce1fb51 100644 --- a/homeassistant/components/modbus/cover.py +++ b/homeassistant/components/modbus/cover.py @@ -174,7 +174,7 @@ class ModbusCover(CoverEntity, RestoreEntity): else: await self._async_write_register(self._state_open) - self.async_update() + await self.async_update() async def async_close_cover(self, **kwargs: Any) -> None: """Close cover.""" @@ -183,7 +183,7 @@ class ModbusCover(CoverEntity, RestoreEntity): else: await self._async_write_register(self._state_closed) - self.async_update() + await self.async_update() async def async_update(self, now=None): """Update the state of the cover.""" diff --git a/homeassistant/components/modbus/switch.py b/homeassistant/components/modbus/switch.py index 4495a72c63a..9c8f2d1d12d 100644 --- a/homeassistant/components/modbus/switch.py +++ b/homeassistant/components/modbus/switch.py @@ -134,7 +134,7 @@ class ModbusSwitch(SwitchEntity, RestoreEntity): else: self._available = True if self._verify_active: - self.async_update() + await self.async_update() else: self._is_on = True self.async_write_ha_state() @@ -150,7 +150,7 @@ class ModbusSwitch(SwitchEntity, RestoreEntity): else: self._available = True if self._verify_active: - self.async_update() + await self.async_update() else: self._is_on = False self.async_write_ha_state()