mirror of
https://github.com/home-assistant/core.git
synced 2025-11-09 02:49:40 +00:00
Migrate restore_state helper to use registry loading pattern (#93773)
* Migrate restore_state helper to use registry loading pattern As more entities have started using restore_state over time, it has become a startup bottleneck as each entity being added is creating a task to load restore state data that is already loaded since it is a singleton We now use the same pattern as the registry helpers * fix refactoring error -- guess I am tired * fixes * fix tests * fix more * fix more * fix zha tests * fix zha tests * comments * fix error * add missing coverage * s/DATA_RESTORE_STATE_TASK/DATA_RESTORE_STATE/g
This commit is contained in:
@@ -32,6 +32,7 @@ from .helpers import (
|
||||
entity_registry,
|
||||
issue_registry,
|
||||
recorder,
|
||||
restore_state,
|
||||
template,
|
||||
)
|
||||
from .helpers.dispatcher import async_dispatcher_send
|
||||
@@ -248,6 +249,7 @@ async def load_registries(hass: core.HomeAssistant) -> None:
|
||||
issue_registry.async_load(hass),
|
||||
hass.async_add_executor_job(_cache_uname_processor),
|
||||
template.async_load_custom_templates(hass),
|
||||
restore_state.async_load(hass),
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user