mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Use hass.loop.create_future() in zha (#100056)
* Use hass.loop.create_future() in zha * Remove not needed method
This commit is contained in:
parent
958b923783
commit
9f3b1a8d44
@ -59,7 +59,6 @@ class BaseZhaEntity(LogMixin, entity.Entity):
|
|||||||
self._extra_state_attributes: dict[str, Any] = {}
|
self._extra_state_attributes: dict[str, Any] = {}
|
||||||
self._zha_device = zha_device
|
self._zha_device = zha_device
|
||||||
self._unsubs: list[Callable[[], None]] = []
|
self._unsubs: list[Callable[[], None]] = []
|
||||||
self.remove_future: asyncio.Future[Any] = asyncio.Future()
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def unique_id(self) -> str:
|
def unique_id(self) -> str:
|
||||||
@ -143,6 +142,8 @@ class BaseZhaEntity(LogMixin, entity.Entity):
|
|||||||
class ZhaEntity(BaseZhaEntity, RestoreEntity):
|
class ZhaEntity(BaseZhaEntity, RestoreEntity):
|
||||||
"""A base class for non group ZHA entities."""
|
"""A base class for non group ZHA entities."""
|
||||||
|
|
||||||
|
remove_future: asyncio.Future[Any]
|
||||||
|
|
||||||
def __init_subclass__(cls, id_suffix: str | None = None, **kwargs: Any) -> None:
|
def __init_subclass__(cls, id_suffix: str | None = None, **kwargs: Any) -> None:
|
||||||
"""Initialize subclass.
|
"""Initialize subclass.
|
||||||
|
|
||||||
@ -188,7 +189,7 @@ class ZhaEntity(BaseZhaEntity, RestoreEntity):
|
|||||||
|
|
||||||
async def async_added_to_hass(self) -> None:
|
async def async_added_to_hass(self) -> None:
|
||||||
"""Run when about to be added to hass."""
|
"""Run when about to be added to hass."""
|
||||||
self.remove_future = asyncio.Future()
|
self.remove_future = self.hass.loop.create_future()
|
||||||
self.async_accept_signal(
|
self.async_accept_signal(
|
||||||
None,
|
None,
|
||||||
f"{SIGNAL_REMOVE}_{self.zha_device.ieee}",
|
f"{SIGNAL_REMOVE}_{self.zha_device.ieee}",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user