1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Index the entity registry (#37994)

This commit is contained in:
J. Nick Koston
2020-07-19 19:52:41 -10:00
committed by GitHub
parent 41421b56a4
commit 890562e3ae
3 changed files with 43 additions and 22 deletions

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