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:
Paulus Schoutsen 2018-09-17 13:39:30 +02:00 committed by GitHub
parent 849a93e0a6
commit b8257866f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 269 additions and 78 deletions

View file

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