From dfc656a2c617e88c2d1097f43c663ddb266cd42e Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 8 Oct 2020 02:22:16 -0500 Subject: [PATCH] Update lock to use async_add_executor_job (#41458) --- homeassistant/components/lock/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/lock/__init__.py b/homeassistant/components/lock/__init__.py index addd5d9a257..84892f3f3fd 100644 --- a/homeassistant/components/lock/__init__.py +++ b/homeassistant/components/lock/__init__.py @@ -101,7 +101,7 @@ class LockEntity(Entity): async def async_lock(self, **kwargs): """Lock the lock.""" - await self.hass.async_add_job(ft.partial(self.lock, **kwargs)) + await self.hass.async_add_executor_job(ft.partial(self.lock, **kwargs)) def unlock(self, **kwargs): """Unlock the lock.""" @@ -109,7 +109,7 @@ class LockEntity(Entity): async def async_unlock(self, **kwargs): """Unlock the lock.""" - await self.hass.async_add_job(ft.partial(self.unlock, **kwargs)) + await self.hass.async_add_executor_job(ft.partial(self.unlock, **kwargs)) def open(self, **kwargs): """Open the door latch.""" @@ -117,7 +117,7 @@ class LockEntity(Entity): async def async_open(self, **kwargs): """Open the door latch.""" - await self.hass.async_add_job(ft.partial(self.open, **kwargs)) + await self.hass.async_add_executor_job(ft.partial(self.open, **kwargs)) @property def state_attributes(self):