Index the entity registry (#37994)

This commit is contained in:
J. Nick Koston authored and GitHub committed 2020-07-19 22:52:41 -07:00
1 parent 41421b56a4
commit 890562e3ae
3 files changed
+43 -22

No files matched your search

+1
View File
@@ -351,6 +351,7 @@ def mock_registry(hass, mock_entries=None):
"""Mock the Entity Registry."""
registry = entity_registry.EntityRegistry(hass)
registry.entities = mock_entries or OrderedDict()
registry._rebuild_index()
hass.data[entity_registry.DATA_REGISTRY] = registry
return registry