mirror of
https://github.com/home-assistant/core.git
synced 2025-11-10 03:19:34 +00:00
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:
@@ -78,14 +78,14 @@ DEVICE_ACTION_TYPES = [CONF_TOGGLE, CONF_TURN_OFF, CONF_TURN_ON]
|
||||
|
||||
ACTION_SCHEMA = cv.DEVICE_ACTION_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(DEVICE_ACTION_TYPES),
|
||||
}
|
||||
)
|
||||
|
||||
CONDITION_SCHEMA = cv.DEVICE_CONDITION_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_IS_OFF, CONF_IS_ON]),
|
||||
vol.Optional(CONF_FOR): cv.positive_time_period_dict,
|
||||
}
|
||||
@@ -93,7 +93,7 @@ CONDITION_SCHEMA = cv.DEVICE_CONDITION_BASE_SCHEMA.extend(
|
||||
|
||||
_TOGGLE_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_TURNED_OFF, CONF_TURNED_ON]),
|
||||
vol.Optional(CONF_FOR): cv.positive_time_period_dict,
|
||||
}
|
||||
@@ -196,7 +196,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
|
||||
|
||||
Reference in New Issue
Block a user