mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 13:47:35 +00:00
Deduplicate some code in helpers.check_config.async_check_ha_config_file
(#103852)
Tweak helpers.check_config.async_check_ha_config_file
This commit is contained in:
parent
1168956f8c
commit
51b599e1f6
@ -100,16 +100,13 @@ async def async_check_ha_config_file( # noqa: C901
|
|||||||
pack_config = core_config[CONF_PACKAGES].get(package, config)
|
pack_config = core_config[CONF_PACKAGES].get(package, config)
|
||||||
result.add_warning(message, domain, pack_config)
|
result.add_warning(message, domain, pack_config)
|
||||||
|
|
||||||
def _comp_error(ex: Exception, domain: str, config: ConfigType) -> None:
|
def _comp_error(ex: Exception, domain: str, component_config: ConfigType) -> None:
|
||||||
"""Handle errors from components: async_log_exception."""
|
"""Handle errors from components: async_log_exception."""
|
||||||
|
message = _format_config_error(ex, domain, component_config)[0]
|
||||||
if domain in frontend_dependencies:
|
if domain in frontend_dependencies:
|
||||||
result.add_error(
|
result.add_error(message, domain, component_config)
|
||||||
_format_config_error(ex, domain, config)[0], domain, config
|
|
||||||
)
|
|
||||||
else:
|
else:
|
||||||
result.add_warning(
|
result.add_warning(message, domain, component_config)
|
||||||
_format_config_error(ex, domain, config)[0], domain, config
|
|
||||||
)
|
|
||||||
|
|
||||||
async def _get_integration(
|
async def _get_integration(
|
||||||
hass: HomeAssistant, domain: str
|
hass: HomeAssistant, domain: str
|
||||||
|
Loading…
x
Reference in New Issue
Block a user