mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 12:47:08 +00:00
Update lock to use async_add_executor_job (#41458)
This commit is contained in:
parent
aa250c2b61
commit
dfc656a2c6
@ -101,7 +101,7 @@ class LockEntity(Entity):
|
|||||||
|
|
||||||
async def async_lock(self, **kwargs):
|
async def async_lock(self, **kwargs):
|
||||||
"""Lock the lock."""
|
"""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):
|
def unlock(self, **kwargs):
|
||||||
"""Unlock the lock."""
|
"""Unlock the lock."""
|
||||||
@ -109,7 +109,7 @@ class LockEntity(Entity):
|
|||||||
|
|
||||||
async def async_unlock(self, **kwargs):
|
async def async_unlock(self, **kwargs):
|
||||||
"""Unlock the lock."""
|
"""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):
|
def open(self, **kwargs):
|
||||||
"""Open the door latch."""
|
"""Open the door latch."""
|
||||||
@ -117,7 +117,7 @@ class LockEntity(Entity):
|
|||||||
|
|
||||||
async def async_open(self, **kwargs):
|
async def async_open(self, **kwargs):
|
||||||
"""Open the door latch."""
|
"""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
|
@property
|
||||||
def state_attributes(self):
|
def state_attributes(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user