1
0
mirror of https://github.com/home-assistant/core.git synced 2026-04-18 07:56:03 +01:00

Raise in EntityComponent.async_prepare_reload on configuration error (#101267)

Co-authored-by: Franck Nijhof <git@frenck.dev>
This commit is contained in:
Erik Montnemery
2026-02-17 07:42:46 +01:00
committed by GitHub
parent e0f39e6392
commit e6b9c2f737
17 changed files with 102 additions and 44 deletions

View File

@@ -15,7 +15,7 @@ import os
from pathlib import Path
import shutil
from types import ModuleType
from typing import TYPE_CHECKING, Any
from typing import TYPE_CHECKING, Any, Literal, overload
from awesomeversion import AwesomeVersion
import voluptuous as vol
@@ -851,6 +851,36 @@ def _get_log_message_and_stack_print_pref(
return (log_message, show_stack_trace, placeholders)
# The complicated overloads are due to a limitation in mypy, details in
# https://github.com/python/mypy/issues/7333
@overload
async def async_process_component_and_handle_errors(
hass: HomeAssistant,
config: ConfigType,
integration: Integration,
) -> ConfigType | None: ...
@overload
async def async_process_component_and_handle_errors(
hass: HomeAssistant,
config: ConfigType,
integration: Integration,
*,
raise_on_failure: Literal[True],
) -> ConfigType: ...
@overload
async def async_process_component_and_handle_errors(
hass: HomeAssistant,
config: ConfigType,
integration: Integration,
*,
raise_on_failure: bool,
) -> ConfigType | None: ...
async def async_process_component_and_handle_errors(
hass: HomeAssistant,
config: ConfigType,