mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 17:27:52 +00:00
Use HassKey for setup and bootstrap (#116998)
This commit is contained in:
parent
fd5885ec83
commit
c50a340cbc
@ -101,6 +101,7 @@ from .setup import (
|
||||
async_setup_component,
|
||||
)
|
||||
from .util.async_ import create_eager_task
|
||||
from .util.hass_dict import HassKey
|
||||
from .util.logging import async_activate_log_queue_handler
|
||||
from .util.package import async_get_user_site, is_virtual_env
|
||||
|
||||
@ -120,7 +121,7 @@ SETUP_ORDER_SORT_KEY = partial(contains, BASE_PLATFORMS)
|
||||
ERROR_LOG_FILENAME = "home-assistant.log"
|
||||
|
||||
# hass.data key for logging information.
|
||||
DATA_REGISTRIES_LOADED = "bootstrap_registries_loaded"
|
||||
DATA_REGISTRIES_LOADED: HassKey[None] = HassKey("bootstrap_registries_loaded")
|
||||
|
||||
LOG_SLOW_STARTUP_INTERVAL = 60
|
||||
SLOW_STARTUP_CHECK_INTERVAL = 1
|
||||
|
@ -69,6 +69,7 @@ from .helpers.typing import ConfigType
|
||||
from .loader import ComponentProtocol, Integration, IntegrationNotFound
|
||||
from .requirements import RequirementsNotFound, async_get_integration_with_requirements
|
||||
from .util.async_ import create_eager_task
|
||||
from .util.hass_dict import HassKey
|
||||
from .util.package import is_docker_env
|
||||
from .util.unit_system import get_unit_system, validate_unit_system
|
||||
from .util.yaml import SECRET_YAML, Secrets, YamlTypeError, load_yaml_dict
|
||||
@ -81,7 +82,7 @@ RE_ASCII = re.compile(r"\033\[[^m]*m")
|
||||
YAML_CONFIG_FILE = "configuration.yaml"
|
||||
VERSION_FILE = ".HA_VERSION"
|
||||
CONFIG_DIR_NAME = ".homeassistant"
|
||||
DATA_CUSTOMIZE = "hass_customize"
|
||||
DATA_CUSTOMIZE: HassKey[EntityValues] = HassKey("hass_customize")
|
||||
|
||||
AUTOMATION_CONFIG_PATH = "automations.yaml"
|
||||
SCRIPT_CONFIG_PATH = "scripts.yaml"
|
||||
|
@ -14,6 +14,7 @@ from .helpers.deprecation import (
|
||||
dir_with_deprecated_constants,
|
||||
)
|
||||
from .util.event_type import EventType
|
||||
from .util.hass_dict import HassKey
|
||||
from .util.signal_type import SignalType
|
||||
|
||||
if TYPE_CHECKING:
|
||||
@ -1625,7 +1626,7 @@ SIGNAL_BOOTSTRAP_INTEGRATIONS: SignalType[dict[str, float]] = SignalType(
|
||||
|
||||
|
||||
# hass.data key for logging information.
|
||||
KEY_DATA_LOGGING = "logging"
|
||||
KEY_DATA_LOGGING: HassKey[str] = HassKey("logging")
|
||||
|
||||
|
||||
# Date/Time formats
|
||||
|
@ -73,9 +73,11 @@ DATA_SETUP_TIME: HassKey[
|
||||
defaultdict[str, defaultdict[str | None, defaultdict[SetupPhases, float]]]
|
||||
] = HassKey("setup_time")
|
||||
|
||||
DATA_DEPS_REQS = "deps_reqs_processed"
|
||||
DATA_DEPS_REQS: HassKey[set[str]] = HassKey("deps_reqs_processed")
|
||||
|
||||
DATA_PERSISTENT_ERRORS = "bootstrap_persistent_errors"
|
||||
DATA_PERSISTENT_ERRORS: HassKey[dict[str, str | None]] = HassKey(
|
||||
"bootstrap_persistent_errors"
|
||||
)
|
||||
|
||||
NOTIFY_FOR_TRANSLATION_KEYS = [
|
||||
"config_validation_err",
|
||||
|
Loading…
x
Reference in New Issue
Block a user