From: Giorgio Ravera Date: Sun, 2 Feb 2020 13:37:49 +0000 (+0100) Subject: Added notification_id to notify script X-Git-Url: http://git.giorgioravera.it/?a=commitdiff_plain;h=5a3249b76a9577dbaa657657e6978a088416aa2b;p=homeassistant.git Added notification_id to notify script --- diff --git a/automation/update_notifications.yaml b/automation/update_notifications.yaml index 0e815428..a3657bdf 100644 --- a/automation/update_notifications.yaml +++ b/automation/update_notifications.yaml @@ -15,6 +15,7 @@ data_template: title: "Home Assistant - Aggiornamento" message: "E' disponibile un aggiornamento per Home Assistant {{ state_attr('binary_sensor.updater', 'newest_version') }}. {{now().strftime('%Y-%m-%d %I:%M %p')}}" + notification_id: "update" enable_persistent: 1 ###################################################################### @@ -34,6 +35,7 @@ data_template: title: "Shelly - Aggiornamento" message: "Sono disponibili aggiornamenti per i dispositivi Shelly" + notification_id: "update" enable_persistent: 1 ###################################################################### @@ -53,4 +55,5 @@ data_template: title: "HACS - Aggiornamento" message: "Sono disponibili aggiornamenti per i moduli HACS" + notification_id: "update" enable_persistent: 1 diff --git a/script/notify.yaml b/script/notify.yaml index 46262267..12a00a7b 100644 --- a/script/notify.yaml +++ b/script/notify.yaml @@ -3,6 +3,7 @@ # Inputs: # - title # - message +# - notification_id # - enable_persistent # # Operations: @@ -40,6 +41,12 @@ notify_text_internal: data_template: title: "{{ title }}" message: "{{ message }}" + notification_id: >- + {# Check Null Input #} + {% if notification_id | length == 0 %} + {% set notification_id = 'generic' %} + {% endif %} + {{ notification_id }} notify_text: alias: Notifiche testuali @@ -57,6 +64,7 @@ notify_text: {% endif %} {{ title }} message: "{{ message }}" + notification_id: "{{ notification_id }}" enable_persistent: "{{ enable_persistent }}" ###################################################################### @@ -157,6 +165,7 @@ notify_voice: # - volume_level # _ language # - message +# - notification_id # - enable_persistent # # Operations: @@ -171,6 +180,7 @@ notify_all: data_template: title: "{{ title }}" message: "{{ message }}" + notification_id: "{{ notification_id }}" enable_persistent: "{{ enable_persistent }}" - service: script.notify_voice