-
Notifications
You must be signed in to change notification settings - Fork 440
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
254 changed files
with
44,955 additions
and
9,204 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
blueprints/script/homeassistant/confirmable_notification.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
blueprint: | ||
name: Confirmable Notification | ||
description: >- | ||
A script that sends an actionable notification with a confirmation before | ||
running the specified action. | ||
domain: script | ||
source_url: https://github.com/home-assistant/core/blob/master/homeassistant/components/script/blueprints/confirmable_notification.yaml | ||
input: | ||
notify_device: | ||
name: Device to notify | ||
description: Device needs to run the official Home Assistant app to receive notifications. | ||
selector: | ||
device: | ||
integration: mobile_app | ||
title: | ||
name: "Title" | ||
description: "The title of the button shown in the notification." | ||
default: "" | ||
selector: | ||
text: | ||
message: | ||
name: "Message" | ||
description: "The message body" | ||
selector: | ||
text: | ||
confirm_text: | ||
name: "Confirmation Text" | ||
description: "Text to show on the confirmation button" | ||
default: "Confirm" | ||
selector: | ||
text: | ||
confirm_action: | ||
name: "Confirmation Action" | ||
description: "Action to run when notification is confirmed" | ||
default: [] | ||
selector: | ||
action: | ||
dismiss_text: | ||
name: "Dismiss Text" | ||
description: "Text to show on the dismiss button" | ||
default: "Dismiss" | ||
selector: | ||
text: | ||
dismiss_action: | ||
name: "Dismiss Action" | ||
description: "Action to run when notification is dismissed" | ||
default: [] | ||
selector: | ||
action: | ||
|
||
mode: restart | ||
|
||
sequence: | ||
- alias: "Send notification" | ||
domain: mobile_app | ||
type: notify | ||
device_id: !input notify_device | ||
title: !input title | ||
message: !input message | ||
data: | ||
actions: | ||
- action: "CONFIRM" | ||
title: !input confirm_text | ||
- action: "DISMISS" | ||
title: !input dismiss_text | ||
- alias: "Awaiting response" | ||
wait_for_trigger: | ||
- platform: event | ||
event_type: mobile_app_notification_action | ||
- choose: | ||
- conditions: "{{ wait.trigger.event.data.action == 'CONFIRM' }}" | ||
sequence: !input confirm_action | ||
- conditions: "{{ wait.trigger.event.data.action == 'DISMISS' }}" | ||
sequence: !input dismiss_action |
Oops, something went wrong.