mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Mark entities as unavailable when they are removed but are still registered (#45528)
* Mark entities as unavailable when they are removed but are still registered * Add sync_entity_lifecycle to collection helper * Remove debug print * Lint * Fix tests * Fix tests * Update zha * Update zone * Fix tests * Update hyperion * Update rfxtrx * Fix tests * Pass force_remove=True from integrations Co-authored-by: Erik <erik@montnemery.com>
This commit is contained in:
@@ -19,7 +19,7 @@ from homeassistant.components.cover import (
|
||||
STATE_OPENING,
|
||||
)
|
||||
from homeassistant.components.smartthings.const import DOMAIN, SIGNAL_SMARTTHINGS_UPDATE
|
||||
from homeassistant.const import ATTR_BATTERY_LEVEL, ATTR_ENTITY_ID
|
||||
from homeassistant.const import ATTR_BATTERY_LEVEL, ATTR_ENTITY_ID, STATE_UNAVAILABLE
|
||||
from homeassistant.helpers.dispatcher import async_dispatcher_send
|
||||
|
||||
from .conftest import setup_platform
|
||||
@@ -193,4 +193,4 @@ async def test_unload_config_entry(hass, device_factory):
|
||||
# Act
|
||||
await hass.config_entries.async_forward_entry_unload(config_entry, COVER_DOMAIN)
|
||||
# Assert
|
||||
assert not hass.states.get("cover.garage")
|
||||
assert hass.states.get("cover.garage").state == STATE_UNAVAILABLE
|
||||
|
||||
Reference in New Issue
Block a user