mirror of
https://github.com/home-assistant/core.git
synced 2025-07-31 01:07:10 +00:00
Reorder
This commit is contained in:
parent
3d6cfc0018
commit
b697bf13d2
@ -1423,11 +1423,11 @@ class Entity(
|
|||||||
# Set the entity's state will to unavailable + ATTR_RESTORED: True
|
# Set the entity's state will to unavailable + ATTR_RESTORED: True
|
||||||
self.registry_entry.write_unavailable_state(self.hass)
|
self.registry_entry.write_unavailable_state(self.hass)
|
||||||
else:
|
else:
|
||||||
self.hass.states.async_remove(self.entity_id, context=self._context)
|
|
||||||
# The check for self.platform guards against integrations not using an
|
# The check for self.platform guards against integrations not using an
|
||||||
# EntityComponent and can be removed in HA Core 2024.1
|
# EntityComponent and can be removed in HA Core 2024.1
|
||||||
if self.platform:
|
if self.platform:
|
||||||
del entity_sources(self.hass)[self.entity_id]
|
del entity_sources(self.hass)[self.entity_id]
|
||||||
|
self.hass.states.async_remove(self.entity_id, context=self._context)
|
||||||
|
|
||||||
async def async_added_to_hass(self) -> None:
|
async def async_added_to_hass(self) -> None:
|
||||||
"""Run when entity about to be added to hass.
|
"""Run when entity about to be added to hass.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user