mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
Fix flapping reload tests (#34837)
This commit is contained in:
parent
942cd7caa5
commit
13f4393042
@ -493,13 +493,14 @@ class Entity(ABC):
|
||||
async def async_remove(self) -> None:
|
||||
"""Remove entity from Home Assistant."""
|
||||
assert self.hass is not None
|
||||
await self.async_internal_will_remove_from_hass()
|
||||
await self.async_will_remove_from_hass()
|
||||
|
||||
if self._on_remove is not None:
|
||||
while self._on_remove:
|
||||
self._on_remove.pop()()
|
||||
|
||||
await self.async_internal_will_remove_from_hass()
|
||||
await self.async_will_remove_from_hass()
|
||||
|
||||
self.hass.states.async_remove(self.entity_id, context=self._context)
|
||||
|
||||
async def async_added_to_hass(self) -> None:
|
||||
|
Loading…
x
Reference in New Issue
Block a user