Use singleton helper for registries (#117027)

This commit is contained in:
J. Nick Koston 2024-05-07 14:04:01 -05:00 committed by GitHub
parent 6e024d54f1
commit 26cc1cd3db
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 27 additions and 18 deletions

View file

@ -631,6 +631,7 @@ def mock_registry(
registry.entities[key] = entry
hass.data[er.DATA_REGISTRY] = registry
er.async_get.cache_clear()
return registry
@ -654,6 +655,7 @@ def mock_area_registry(
registry.areas[key] = entry
hass.data[ar.DATA_REGISTRY] = registry
ar.async_get.cache_clear()
return registry
@ -682,6 +684,7 @@ def mock_device_registry(
registry.deleted_devices = dr.DeviceRegistryItems()
hass.data[dr.DATA_REGISTRY] = registry
dr.async_get.cache_clear()
return registry