1
0
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:
Paulus Schoutsen
2019-12-31 14:29:43 +01:00
committed by GitHub
parent 2c1a7a54cd
commit bb14a083f0
8 changed files with 293 additions and 18 deletions

View File

@@ -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):