mirror of
https://github.com/home-assistant/core.git
synced 2025-07-29 18:28:14 +02:00
Speed up singleton decorator so it can be used more places (#116292)
This commit is contained in:
@ -90,7 +90,11 @@ from .helpers.system_info import async_get_system_info
|
||||
from .helpers.typing import ConfigType
|
||||
from .setup import (
|
||||
BASE_PLATFORMS,
|
||||
DATA_SETUP_STARTED,
|
||||
# _setup_started is marked as protected to make it clear
|
||||
# that it is not part of the public API and should not be used
|
||||
# by integrations. It is only used for internal tracking of
|
||||
# which integrations are being set up.
|
||||
_setup_started,
|
||||
async_get_setup_timings,
|
||||
async_notify_setup_error,
|
||||
async_set_domains_to_be_loaded,
|
||||
@ -913,9 +917,7 @@ async def _async_set_up_integrations(
|
||||
hass: core.HomeAssistant, config: dict[str, Any]
|
||||
) -> None:
|
||||
"""Set up all the integrations."""
|
||||
setup_started: dict[tuple[str, str | None], float] = {}
|
||||
hass.data[DATA_SETUP_STARTED] = setup_started
|
||||
watcher = _WatchPendingSetups(hass, setup_started)
|
||||
watcher = _WatchPendingSetups(hass, _setup_started(hass))
|
||||
watcher.async_start()
|
||||
|
||||
domains_to_setup, integration_cache = await _async_resolve_domains_to_setup(
|
||||
|
Reference in New Issue
Block a user