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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user