mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Fix targeting all or none entities in service calls (#68513)
* Fix targeting all or none entities in service calls * Add test
This commit is contained in:
@@ -218,9 +218,12 @@ def async_prepare_call_from_config(
|
||||
|
||||
if CONF_ENTITY_ID in target:
|
||||
registry = entity_registry.async_get(hass)
|
||||
target[CONF_ENTITY_ID] = entity_registry.async_validate_entity_ids(
|
||||
registry, cv.comp_entity_ids_or_uuids(target[CONF_ENTITY_ID])
|
||||
)
|
||||
entity_ids = cv.comp_entity_ids_or_uuids(target[CONF_ENTITY_ID])
|
||||
if entity_ids not in (ENTITY_MATCH_ALL, ENTITY_MATCH_NONE):
|
||||
entity_ids = entity_registry.async_validate_entity_ids(
|
||||
registry, entity_ids
|
||||
)
|
||||
target[CONF_ENTITY_ID] = entity_ids
|
||||
except TemplateError as ex:
|
||||
raise HomeAssistantError(
|
||||
f"Error rendering service target template: {ex}"
|
||||
|
||||
Reference in New Issue
Block a user