Remove migration of entities from deCONZ switch to siren platform (#70600)

This commit is contained in:
Robert Svensson 2022-04-24 23:32:13 +02:00 committed by GitHub
parent 0726bc2cab
commit b15387ffb9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 44 deletions

View file

@ -2,9 +2,7 @@
from unittest.mock import patch
from homeassistant.components.deconz.const import DOMAIN as DECONZ_DOMAIN
from homeassistant.components.siren import ATTR_DURATION, DOMAIN as SIREN_DOMAIN
from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN
from homeassistant.const import (
ATTR_ENTITY_ID,
SERVICE_TURN_OFF,
@ -13,7 +11,6 @@ from homeassistant.const import (
STATE_ON,
STATE_UNAVAILABLE,
)
from homeassistant.helpers import entity_registry as er
from .test_gateway import (
DECONZ_WEB_REQUEST,
@ -103,30 +100,3 @@ async def test_sirens(hass, aioclient_mock, mock_deconz_websocket):
await hass.config_entries.async_remove(config_entry.entry_id)
await hass.async_block_till_done()
assert len(hass.states.async_all()) == 0
async def test_remove_legacy_siren_switch(hass, aioclient_mock):
"""Test that switch platform cleans up legacy siren entities."""
unique_id = "00:00:00:00:00:00:00:00-00"
registry = er.async_get(hass)
switch_siren_entity = registry.async_get_or_create(
SWITCH_DOMAIN, DECONZ_DOMAIN, unique_id
)
assert switch_siren_entity
data = {
"lights": {
"1": {
"name": "Warning device",
"type": "Warning device",
"state": {"alert": "lselect", "reachable": True},
"uniqueid": unique_id,
},
}
}
with patch.dict(DECONZ_WEB_REQUEST, data):
await setup_deconz_integration(hass, aioclient_mock)
assert not registry.async_get(switch_siren_entity.entity_id)