From 6c0d5fa1d6ac76b0e9c25798168018b4eb623828 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" <nick@koston.org> Date: Wed, 14 Oct 2020 01:19:09 -0500 Subject: [PATCH] Switch legacy async_add_job to async_add_executor_job in wemo (#41807) These calls were already using async_add_executor_job in some of the other platforms --- homeassistant/components/wemo/switch.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/wemo/switch.py b/homeassistant/components/wemo/switch.py index 7cc88f552bf..fc00d4ea8b5 100644 --- a/homeassistant/components/wemo/switch.py +++ b/homeassistant/components/wemo/switch.py @@ -217,7 +217,7 @@ class WemoSwitch(SwitchEntity): self._update_lock = asyncio.Lock() registry = self.hass.data[WEMO_DOMAIN]["registry"] - await self.hass.async_add_job(registry.register, self.wemo) + await self.hass.async_add_executor_job(registry.register, self.wemo) registry.on(self.wemo, None, self._subscription_callback) async def async_update(self): @@ -242,7 +242,7 @@ class WemoSwitch(SwitchEntity): async def _async_locked_update(self, force_update): """Try updating within an async lock.""" async with self._update_lock: - await self.hass.async_add_job(self._update, force_update) + await self.hass.async_add_executor_job(self._update, force_update) def _update(self, force_update): """Update the device state.""" -- GitLab