Clean up device update, add via-hub (#16659)
* Clean up device update, add via-hub * Test loading/saving data * Lint * Add to Hue" * Lint + tests
This commit is contained in:
parent
849a93e0a6
commit
b8257866f5
13 changed files with 269 additions and 78 deletions
|
@ -6,7 +6,7 @@ import pytest
|
|||
|
||||
from homeassistant.helpers import entity_registry
|
||||
|
||||
from tests.common import mock_registry
|
||||
from tests.common import mock_registry, flush_store
|
||||
|
||||
|
||||
YAML__OPEN_PATH = 'homeassistant.util.yaml.open'
|
||||
|
@ -77,8 +77,7 @@ async def test_loading_saving_data(hass, registry):
|
|||
|
||||
# Now load written data in new registry
|
||||
registry2 = entity_registry.EntityRegistry(hass)
|
||||
registry2._store = registry._store
|
||||
|
||||
await flush_store(registry._store)
|
||||
await registry2.async_load()
|
||||
|
||||
# Ensure same order
|
||||
|
@ -192,6 +191,8 @@ async def test_removing_config_entry_id(registry):
|
|||
'light', 'hue', '5678', config_entry_id='mock-id-1')
|
||||
assert entry.config_entry_id == 'mock-id-1'
|
||||
registry.async_clear_config_entry('mock-id-1')
|
||||
|
||||
entry = registry.entities[entry.entity_id]
|
||||
assert entry.config_entry_id is None
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue