Add aliases to actions in automation blueprints (#47940)

pull/48001/head
Klaas Schoute 2021-03-16 17:14:07 +01:00 committed by GitHub
parent 389891d13d
commit 0097169dd3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 8 deletions

View File

@ -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

View File

@ -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 }}"

View File

@ -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",