Look at registry before pulling zwave config values (#14408)

* Look at registry before deciding on ID for zwave values

* Reuse the new function
This commit is contained in:
Andrey authored and Paulus Schoutsen committed 2018-05-12 17:45:36 -04:00
1 parent 7aec098a05
commit d1228d5cf4
5 files changed
+87 -18

No files matched your search

+10
View File
@@ -180,3 +180,13 @@ test.disabled_hass:
assert entry_disabled_hass.disabled_by == entity_registry.DISABLED_HASS
assert entry_disabled_user.disabled
assert entry_disabled_user.disabled_by == entity_registry.DISABLED_USER
@asyncio.coroutine
def test_async_get_entity_id(registry):
"""Test that entity_id is returned."""
entry = registry.async_get_or_create('light', 'hue', '1234')
assert entry.entity_id == 'light.hue_1234'
assert registry.async_get_entity_id(
'light', 'hue', '1234') == 'light.hue_1234'
assert registry.async_get_entity_id('light', 'hue', '123') is None