Add aliases to actions in automation blueprints (#47940)
parent
389891d13d
commit
0097169dd3
|
@ -38,13 +38,17 @@ trigger:
|
|||
to: "on"
|
||||
|
||||
action:
|
||||
- service: light.turn_on
|
||||
- alias: "Turn on the light"
|
||||
service: light.turn_on
|
||||
target: !input light_target
|
||||
- wait_for_trigger:
|
||||
- alias: "Wait until there is no motion from device"
|
||||
wait_for_trigger:
|
||||
platform: state
|
||||
entity_id: !input motion_entity
|
||||
from: "on"
|
||||
to: "off"
|
||||
- delay: !input no_motion_wait
|
||||
- service: light.turn_off
|
||||
- alias: "Wait the number of seconds that has been set"
|
||||
delay: !input no_motion_wait
|
||||
- alias: "Turn off the light"
|
||||
service: light.turn_off
|
||||
target: !input light_target
|
||||
|
|
|
@ -37,7 +37,8 @@ condition:
|
|||
value_template: "{{ trigger.from_state.state == zone_state and trigger.to_state.state != zone_state }}"
|
||||
|
||||
action:
|
||||
domain: mobile_app
|
||||
type: notify
|
||||
device_id: !input notify_device
|
||||
message: "{{ person_name }} has left {{ zone_state }}"
|
||||
- alias: "Notify that a person has left the zone"
|
||||
domain: mobile_app
|
||||
type: notify
|
||||
device_id: !input notify_device
|
||||
message: "{{ person_name }} has left {{ zone_state }}"
|
||||
|
|
|
@ -84,6 +84,7 @@ async def test_notify_leaving_zone(hass):
|
|||
_hass, config, variables, _context = mock_call_action.mock_calls[0][1]
|
||||
message_tpl = config.pop("message")
|
||||
assert config == {
|
||||
"alias": "Notify that a person has left the zone",
|
||||
"domain": "mobile_app",
|
||||
"type": "notify",
|
||||
"device_id": "abcdefgh",
|
||||
|
|
Loading…
Reference in New Issue