import voluptuous as vol
from . import auth as auth
from .const import ATTR_ASSUMED_STATE as ATTR_ASSUMED_STATE, ATTR_FRIENDLY_NAME as ATTR_FRIENDLY_NAME, ATTR_HIDDEN as ATTR_HIDDEN, CONF_ALLOWLIST_EXTERNAL_DIRS as CONF_ALLOWLIST_EXTERNAL_DIRS, CONF_ALLOWLIST_EXTERNAL_URLS as CONF_ALLOWLIST_EXTERNAL_URLS, CONF_AUTH_MFA_MODULES as CONF_AUTH_MFA_MODULES, CONF_AUTH_PROVIDERS as CONF_AUTH_PROVIDERS, CONF_COUNTRY as CONF_COUNTRY, CONF_CURRENCY as CONF_CURRENCY, CONF_CUSTOMIZE as CONF_CUSTOMIZE, CONF_CUSTOMIZE_DOMAIN as CONF_CUSTOMIZE_DOMAIN, CONF_CUSTOMIZE_GLOB as CONF_CUSTOMIZE_GLOB, CONF_ELEVATION as CONF_ELEVATION, CONF_EXTERNAL_URL as CONF_EXTERNAL_URL, CONF_ID as CONF_ID, CONF_INTERNAL_URL as CONF_INTERNAL_URL, CONF_LANGUAGE as CONF_LANGUAGE, CONF_LATITUDE as CONF_LATITUDE, CONF_LEGACY_TEMPLATES as CONF_LEGACY_TEMPLATES, CONF_LONGITUDE as CONF_LONGITUDE, CONF_MEDIA_DIRS as CONF_MEDIA_DIRS, CONF_NAME as CONF_NAME, CONF_PACKAGES as CONF_PACKAGES, CONF_PLATFORM as CONF_PLATFORM, CONF_TEMPERATURE_UNIT as CONF_TEMPERATURE_UNIT, CONF_TIME_ZONE as CONF_TIME_ZONE, CONF_TYPE as CONF_TYPE, CONF_UNIT_SYSTEM as CONF_UNIT_SYSTEM, LEGACY_CONF_WHITELIST_EXTERNAL_DIRS as LEGACY_CONF_WHITELIST_EXTERNAL_DIRS, __version__ as __version__
from .core import ConfigSource as ConfigSource, HomeAssistant as HomeAssistant, callback as callback
from .exceptions import ConfigValidationError as ConfigValidationError, HomeAssistantError as HomeAssistantError
from .generated.currencies import HISTORIC_CURRENCIES as HISTORIC_CURRENCIES
from .helpers.entity_values import EntityValues as EntityValues
from .helpers.typing import ConfigType as ConfigType
from .loader import ComponentProtocol as ComponentProtocol, Integration as Integration, IntegrationNotFound as IntegrationNotFound
from .requirements import RequirementsNotFound as RequirementsNotFound, async_get_integration_with_requirements as async_get_integration_with_requirements
from .util.package import is_docker_env as is_docker_env
from .util.unit_system import get_unit_system as get_unit_system, validate_unit_system as validate_unit_system
from .util.yaml import SECRET_YAML as SECRET_YAML, Secrets as Secrets, YamlTypeError as YamlTypeError, load_yaml_dict as load_yaml_dict
from .util.yaml.objects import NodeStrClass as NodeStrClass
from _typeshed import Incomplete
from collections.abc import Callable as Callable, Iterable, Sequence
from dataclasses import dataclass
from enum import StrEnum
from typing import Any

_LOGGER: Incomplete
RE_YAML_ERROR: Incomplete
RE_ASCII: Incomplete
YAML_CONFIG_FILE: str
VERSION_FILE: str
CONFIG_DIR_NAME: str
DATA_CUSTOMIZE: str
AUTOMATION_CONFIG_PATH: str
SCRIPT_CONFIG_PATH: str
SCENE_CONFIG_PATH: str
LOAD_EXCEPTIONS: Incomplete
INTEGRATION_LOAD_EXCEPTIONS: Incomplete
SAFE_MODE_FILENAME: str
DEFAULT_CONFIG: Incomplete
DEFAULT_SECRETS: str
TTS_PRE_92: str
TTS_92: str

class ConfigErrorTranslationKey(StrEnum):
    CONFIG_VALIDATION_ERR: str
    PLATFORM_CONFIG_VALIDATION_ERR: str
    COMPONENT_IMPORT_ERR: str
    CONFIG_PLATFORM_IMPORT_ERR: str
    CONFIG_VALIDATOR_UNKNOWN_ERR: str
    CONFIG_SCHEMA_UNKNOWN_ERR: str
    PLATFORM_VALIDATOR_UNKNOWN_ERR: str
    PLATFORM_COMPONENT_LOAD_ERR: str
    PLATFORM_COMPONENT_LOAD_EXC: str
    PLATFORM_SCHEMA_VALIDATOR_ERR: str
    INTEGRATION_CONFIG_ERROR: str

@dataclass
class ConfigExceptionInfo:
    exception: Exception
    translation_key: ConfigErrorTranslationKey
    platform_path: str
    config: ConfigType
    integration_link: str | None
    def __init__(self, exception, translation_key, platform_path, config, integration_link) -> None: ...

@dataclass
class IntegrationConfigInfo:
    config: ConfigType | None
    exception_info_list: list[ConfigExceptionInfo]
    def __init__(self, config, exception_info_list) -> None: ...

def _no_duplicate_auth_provider(configs: Sequence[dict[str, Any]]) -> Sequence[dict[str, Any]]: ...
def _no_duplicate_auth_mfa_module(configs: Sequence[dict[str, Any]]) -> Sequence[dict[str, Any]]: ...
def _filter_bad_internal_external_urls(conf: dict) -> dict: ...

PACKAGES_CONFIG_SCHEMA: Incomplete
CUSTOMIZE_DICT_SCHEMA: Incomplete
CUSTOMIZE_CONFIG_SCHEMA: Incomplete

def _raise_issue_if_historic_currency(hass: HomeAssistant, currency: str) -> None: ...
def _raise_issue_if_no_country(hass: HomeAssistant, country: str | None) -> None: ...
def _raise_issue_if_legacy_templates(hass: HomeAssistant, legacy_templates: bool | None) -> None: ...
def _validate_currency(data: Any) -> Any: ...

CORE_CONFIG_SCHEMA: Incomplete

def get_default_config_dir() -> str: ...
async def async_ensure_config_exists(hass: HomeAssistant) -> bool: ...
async def async_create_default_config(hass: HomeAssistant) -> bool: ...
def _write_default_config(config_dir: str) -> bool: ...
async def async_hass_config_yaml(hass: HomeAssistant) -> dict: ...
def load_yaml_config_file(config_path: str, secrets: Secrets | None = None) -> dict[Any, Any]: ...
def process_ha_config_upgrade(hass: HomeAssistant) -> None: ...
def async_log_schema_error(exc: vol.Invalid, domain: str, config: dict, hass: HomeAssistant, link: str | None = None) -> None: ...
def async_log_config_validator_error(exc: vol.Invalid | HomeAssistantError, domain: str, config: dict, hass: HomeAssistant, link: str | None = None) -> None: ...
def _get_annotation(item: Any) -> tuple[str, int | str] | None: ...
def _get_by_path(data: dict | list, items: list[str | int]) -> Any: ...
def find_annotation(config: dict | list, path: list[str | int]) -> tuple[str, int | str] | None: ...
def _relpath(hass: HomeAssistant, path: str) -> str: ...
def stringify_invalid(hass: HomeAssistant, exc: vol.Invalid, domain: str, config: dict, link: str | None, max_sub_error_length: int) -> str: ...
def humanize_error(hass: HomeAssistant, validation_error: vol.Invalid, domain: str, config: dict, link: str | None, max_sub_error_length: int = ...) -> str: ...
def format_homeassistant_error(hass: HomeAssistant, exc: HomeAssistantError, domain: str, config: dict, link: str | None = None) -> str: ...
def format_schema_error(hass: HomeAssistant, exc: vol.Invalid, domain: str, config: dict, link: str | None = None) -> str: ...
async def async_process_ha_core_config(hass: HomeAssistant, config: dict) -> None: ...
def _log_pkg_error(hass: HomeAssistant, package: str, component: str, config: dict, message: str) -> None: ...
def _identify_config_schema(module: ComponentProtocol) -> str | None: ...
def _recursive_merge(conf: dict[str, Any], package: dict[str, Any]) -> str | None: ...
async def merge_packages_config(hass: HomeAssistant, config: dict, packages: dict[str, Any], _log_pkg_error: Callable[[HomeAssistant, str, str, dict, str], None] = ...) -> dict: ...
def _get_log_message_and_stack_print_pref(hass: HomeAssistant, domain: str, platform_exception: ConfigExceptionInfo) -> tuple[str | None, bool, dict[str, str]]: ...
async def async_process_component_and_handle_errors(hass: HomeAssistant, config: ConfigType, integration: Integration, raise_on_failure: bool = False) -> ConfigType | None: ...
def async_drop_config_annotations(integration_config_info: IntegrationConfigInfo, integration: Integration) -> ConfigType | None: ...
def async_handle_component_errors(hass: HomeAssistant, integration_config_info: IntegrationConfigInfo, integration: Integration, raise_on_failure: bool = False) -> None: ...
def config_per_platform(config: ConfigType, domain: str) -> Iterable[tuple[str | None, ConfigType]]: ...
def extract_domain_configs(config: ConfigType, domain: str) -> Sequence[str]: ...
async def async_process_component_config(hass: HomeAssistant, config: ConfigType, integration: Integration) -> IntegrationConfigInfo: ...
def config_without_domain(config: ConfigType, domain: str) -> ConfigType: ...
async def async_check_ha_config_file(hass: HomeAssistant) -> str | None: ...
def safe_mode_enabled(config_dir: str) -> bool: ...
async def async_enable_safe_mode(hass: HomeAssistant) -> None: ...
