mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Add await to coroutines in Abode (#33664)
This commit is contained in:
parent
c3c7b68cac
commit
1c25468b21
@ -292,7 +292,7 @@ class AbodeEntity(Entity):
|
|||||||
|
|
||||||
async def async_added_to_hass(self):
|
async def async_added_to_hass(self):
|
||||||
"""Subscribe to Abode connection status updates."""
|
"""Subscribe to Abode connection status updates."""
|
||||||
self.hass.async_add_executor_job(
|
await self.hass.async_add_executor_job(
|
||||||
self._data.abode.events.add_connection_status_callback,
|
self._data.abode.events.add_connection_status_callback,
|
||||||
self.unique_id,
|
self.unique_id,
|
||||||
self._update_connection_status,
|
self._update_connection_status,
|
||||||
@ -302,7 +302,7 @@ class AbodeEntity(Entity):
|
|||||||
|
|
||||||
async def async_will_remove_from_hass(self):
|
async def async_will_remove_from_hass(self):
|
||||||
"""Unsubscribe from Abode connection status updates."""
|
"""Unsubscribe from Abode connection status updates."""
|
||||||
self.hass.async_add_executor_job(
|
await self.hass.async_add_executor_job(
|
||||||
self._data.abode.events.remove_connection_status_callback, self.unique_id,
|
self._data.abode.events.remove_connection_status_callback, self.unique_id,
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -323,7 +323,7 @@ class AbodeDevice(AbodeEntity):
|
|||||||
async def async_added_to_hass(self):
|
async def async_added_to_hass(self):
|
||||||
"""Subscribe to device events."""
|
"""Subscribe to device events."""
|
||||||
await super().async_added_to_hass()
|
await super().async_added_to_hass()
|
||||||
self.hass.async_add_executor_job(
|
await self.hass.async_add_executor_job(
|
||||||
self._data.abode.events.add_device_callback,
|
self._data.abode.events.add_device_callback,
|
||||||
self._device.device_id,
|
self._device.device_id,
|
||||||
self._update_callback,
|
self._update_callback,
|
||||||
@ -332,7 +332,7 @@ class AbodeDevice(AbodeEntity):
|
|||||||
async def async_will_remove_from_hass(self):
|
async def async_will_remove_from_hass(self):
|
||||||
"""Unsubscribe from device events."""
|
"""Unsubscribe from device events."""
|
||||||
await super().async_will_remove_from_hass()
|
await super().async_will_remove_from_hass()
|
||||||
self.hass.async_add_executor_job(
|
await self.hass.async_add_executor_job(
|
||||||
self._data.abode.events.remove_all_device_callbacks, self._device.device_id
|
self._data.abode.events.remove_all_device_callbacks, self._device.device_id
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user