Teach call service script action about entity registry ids (#61172)

This commit is contained in:
Erik Montnemery
2022-01-07 17:42:47 +01:00
committed by GitHub
parent d5d8eefded
commit fc2025509e
3 changed files with 50 additions and 2 deletions

View File

@@ -218,7 +218,10 @@ def async_prepare_call_from_config(
target.update(template.render_complex(conf, variables))
if CONF_ENTITY_ID in target:
target[CONF_ENTITY_ID] = cv.comp_entity_ids(target[CONF_ENTITY_ID])
registry = entity_registry.async_get(hass)
target[CONF_ENTITY_ID] = entity_registry.async_resolve_entity_ids(
registry, cv.comp_entity_ids_or_uuids(target[CONF_ENTITY_ID])
)
except TemplateError as ex:
raise HomeAssistantError(
f"Error rendering service target template: {ex}"