From fc9aa6e2c673d21640e3d5f2ea9f014f674d730d Mon Sep 17 00:00:00 2001 From: Giorgio Ravera Date: Mon, 10 Feb 2020 21:17:07 +0100 Subject: [PATCH] Added update input_binary --- automation/update_notifications.yaml | 64 ++++++++++++++++++++-------- input_boolean/update.yaml | 8 ++++ 2 files changed, 54 insertions(+), 18 deletions(-) create mode 100644 input_boolean/update.yaml diff --git a/automation/update_notifications.yaml b/automation/update_notifications.yaml index a3657bdf..3e75648a 100644 --- a/automation/update_notifications.yaml +++ b/automation/update_notifications.yaml @@ -11,12 +11,15 @@ to: 'on' action: - service: script.notify_text - 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 + - service: script.notify_text + 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 + + - service: input_boolean.turn_on + entity_id: input_boolean.update ###################################################################### # Update Notification: Shelly @@ -31,12 +34,15 @@ to: 'on' action: - service: script.notify_text - data_template: - title: "Shelly - Aggiornamento" - message: "Sono disponibili aggiornamenti per i dispositivi Shelly" - notification_id: "update" - enable_persistent: 1 + - service: script.notify_text + data_template: + title: "Shelly - Aggiornamento" + message: "Sono disponibili aggiornamenti per i dispositivi Shelly" + notification_id: "update" + enable_persistent: 1 + + - service: input_boolean.turn_on + entity_id: input_boolean.update ###################################################################### # Update Notification: HACS @@ -51,9 +57,31 @@ above: 0 action: - service: script.notify_text - data_template: - title: "HACS - Aggiornamento" - message: "Sono disponibili aggiornamenti per i moduli HACS" - notification_id: "update" - enable_persistent: 1 + - service: script.notify_text + data_template: + title: "HACS - Aggiornamento" + message: "Sono disponibili aggiornamenti per i moduli HACS" + notification_id: "update" + enable_persistent: 1 + + - service: input_boolean.turn_on + entity_id: input_boolean.update + +###################################################################### +# Update: Aknowledge update +# +# Actions: +# - persistent_notification.dismiss +###################################################################### +- alias: "Update: Riconoscimento Aggiornamenti" + initial_state: 'on' + + trigger: + platform: state + entity_id: input_boolean.update + to: 'off' + + action: + - service: persistent_notification.dismiss + data_template: + notification_id: "update" diff --git a/input_boolean/update.yaml b/input_boolean/update.yaml new file mode 100644 index 00000000..677ed367 --- /dev/null +++ b/input_boolean/update.yaml @@ -0,0 +1,8 @@ +###################################################################### +# Update: Generic +###################################################################### + +update: + name: Disponibilità Aggiornamenti + initial: off + icon: mdi:cellphone-arrow-down -- 2.47.3