Log the name of automations with condition errors (#46854)

This commit is contained in:
Anders Melchiorsen 2021-02-22 06:34:45 +01:00 committed by GitHub
parent b6b1e725c7
commit b1a24c8bbb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -568,7 +568,7 @@ async def _async_process_config(
) )
if CONF_CONDITION in config_block: if CONF_CONDITION in config_block:
cond_func = await _async_process_if(hass, config, config_block) cond_func = await _async_process_if(hass, name, config, config_block)
if cond_func is None: if cond_func is None:
continue continue
@ -606,7 +606,7 @@ async def _async_process_config(
return blueprints_used return blueprints_used
async def _async_process_if(hass, config, p_config): async def _async_process_if(hass, name, config, p_config):
"""Process if checks.""" """Process if checks."""
if_configs = p_config[CONF_CONDITION] if_configs = p_config[CONF_CONDITION]
@ -634,7 +634,8 @@ async def _async_process_if(hass, config, p_config):
if errors: if errors:
LOGGER.warning( LOGGER.warning(
"Error evaluating condition:\n%s", "Error evaluating condition in '%s':\n%s",
name,
ConditionErrorContainer("condition", errors=errors), ConditionErrorContainer("condition", errors=errors),
) )
return False return False