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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user