1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Add unique ID support to light, cover and media player groups (#53225)

This commit is contained in:
Franck Nijhof
2021-07-20 13:56:23 +02:00
committed by GitHub
parent 51dd95ce35
commit b4a50f5459
6 changed files with 56 additions and 9 deletions

View File

@@ -44,6 +44,7 @@ from homeassistant.const import (
STATE_ON,
STATE_UNAVAILABLE,
)
from homeassistant.helpers import entity_registry as er
from homeassistant.setup import async_setup_component
@@ -58,6 +59,7 @@ async def test_default_state(hass):
"platform": DOMAIN,
"entities": ["light.kitchen", "light.bedroom"],
"name": "Bedroom Group",
"unique_id": "unique_identifier",
}
},
)
@@ -77,6 +79,11 @@ async def test_default_state(hass):
assert state.attributes.get(ATTR_EFFECT_LIST) is None
assert state.attributes.get(ATTR_EFFECT) is None
entity_registry = er.async_get(hass)
entry = entity_registry.async_get("light.bedroom_group")
assert entry
assert entry.unique_id == "unique_identifier"
async def test_state_reporting(hass):
"""Test the state reporting."""
@@ -1064,7 +1071,7 @@ async def test_invalid_service_calls(hass):
"""Test invalid service call arguments get discarded."""
add_entities = MagicMock()
await group.async_setup_platform(
hass, {"entities": ["light.test1", "light.test2"]}, add_entities
hass, {"name": "test", "entities": ["light.test1", "light.test2"]}, add_entities
)
await hass.async_block_till_done()
await hass.async_start()