Use entity registry id in toggle_entity device automations (#94995)

* Use entity registry id in toggle_entity device automations

* Update tests

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
Erik Montnemery
2023-06-26 09:59:01 +02:00
committed by GitHub
parent 408c613731
commit a338e7e242
27 changed files with 1352 additions and 480 deletions

View File

@@ -23,7 +23,7 @@ ENTITY_TRIGGERS = [
TRIGGER_SCHEMA = DEVICE_TRIGGER_BASE_SCHEMA.extend(
{
vol.Required(CONF_ENTITY_ID): cv.entity_id,
vol.Required(CONF_ENTITY_ID): cv.entity_id_or_uuid,
vol.Required(CONF_TYPE): vol.In([CONF_CHANGED_STATES]),
vol.Optional(CONF_FOR): cv.positive_time_period_dict,
}
@@ -73,7 +73,7 @@ async def _async_get_automations(
{
**template,
"device_id": device_id,
"entity_id": entry.entity_id,
"entity_id": entry.id,
"domain": domain,
}
for template in automation_templates