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