mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Store capabilities and supported features in entity registry, restore registered entities on startup (#30094)
* Store capabilities and supported features in entity registry * Restore states at startup * Restore non-disabled entities on HA start * Fix test * Pass device class from entity platform * Clean up restored entities from state machine * Fix Z-Wave test?
This commit is contained in:
@@ -8,7 +8,6 @@ from unittest.mock import Mock, patch
|
||||
import asynctest
|
||||
import pytest
|
||||
|
||||
from homeassistant.components import group
|
||||
from homeassistant.const import ENTITY_MATCH_ALL
|
||||
import homeassistant.core as ha
|
||||
from homeassistant.exceptions import PlatformNotReady
|
||||
@@ -285,15 +284,13 @@ async def test_extract_from_service_filter_out_non_existing_entities(hass):
|
||||
async def test_extract_from_service_no_group_expand(hass):
|
||||
"""Test not expanding a group."""
|
||||
component = EntityComponent(_LOGGER, DOMAIN, hass)
|
||||
test_group = await group.Group.async_create_group(
|
||||
hass, "test_group", ["light.Ceiling", "light.Kitchen"]
|
||||
)
|
||||
await component.async_add_entities([test_group])
|
||||
await component.async_add_entities([MockEntity(entity_id="group.test_group")])
|
||||
|
||||
call = ha.ServiceCall("test", "service", {"entity_id": ["group.test_group"]})
|
||||
|
||||
extracted = await component.async_extract_from_service(call, expand_group=False)
|
||||
assert extracted == [test_group]
|
||||
assert len(extracted) == 1
|
||||
assert extracted[0].entity_id == "group.test_group"
|
||||
|
||||
|
||||
async def test_setup_dependencies_platform(hass):
|
||||
|
||||
Reference in New Issue
Block a user