mirror of
https://github.com/home-assistant/core.git
synced 2025-08-02 04:05:06 +02:00
Combine recorder and frontend bootstrap step (#113985)
This commit is contained in:
@@ -194,16 +194,14 @@ CRITICAL_INTEGRATIONS = {
|
||||
"frontend",
|
||||
}
|
||||
|
||||
SETUP_ORDER = {
|
||||
SETUP_ORDER = (
|
||||
# Load logging as soon as possible
|
||||
"logging": LOGGING_INTEGRATIONS,
|
||||
# Setup frontend
|
||||
"frontend": FRONTEND_INTEGRATIONS,
|
||||
# Setup recorder
|
||||
"recorder": RECORDER_INTEGRATIONS,
|
||||
("logging", LOGGING_INTEGRATIONS),
|
||||
# Setup frontend and recorder
|
||||
("frontend, recorder", {*FRONTEND_INTEGRATIONS, *RECORDER_INTEGRATIONS}),
|
||||
# Start up debuggers. Start these first in case they want to wait.
|
||||
"debugger": DEBUGGER_INTEGRATIONS,
|
||||
}
|
||||
("debugger", DEBUGGER_INTEGRATIONS),
|
||||
)
|
||||
|
||||
|
||||
async def async_setup_hass(
|
||||
@@ -856,10 +854,9 @@ async def _async_set_up_integrations(
|
||||
if "recorder" in domains_to_setup:
|
||||
recorder.async_initialize_recorder(hass)
|
||||
|
||||
pre_stage_domains: dict[str, set[str]] = {
|
||||
name: domains_to_setup & domain_group
|
||||
for name, domain_group in SETUP_ORDER.items()
|
||||
}
|
||||
pre_stage_domains = [
|
||||
(name, domains_to_setup & domain_group) for name, domain_group in SETUP_ORDER
|
||||
]
|
||||
|
||||
# calculate what components to setup in what stage
|
||||
stage_1_domains: set[str] = set()
|
||||
@@ -885,7 +882,7 @@ async def _async_set_up_integrations(
|
||||
|
||||
stage_2_domains = domains_to_setup - stage_1_domains
|
||||
|
||||
for name, domain_group in pre_stage_domains.items():
|
||||
for name, domain_group in pre_stage_domains:
|
||||
if domain_group:
|
||||
stage_2_domains -= domain_group
|
||||
_LOGGER.info("Setting up %s: %s", name, domain_group)
|
||||
|
Reference in New Issue
Block a user