]> git.giorgioravera.it Git - homeassistant.git/commitdiff
Added update input_binary
authorGiorgio Ravera <giorgio.ravera@gmail.com>
Mon, 10 Feb 2020 20:17:07 +0000 (21:17 +0100)
committerGiorgio Ravera <giorgio.ravera@gmail.com>
Mon, 10 Feb 2020 20:17:07 +0000 (21:17 +0100)
automation/update_notifications.yaml
input_boolean/update.yaml [new file with mode: 0644]

index a3657bdf35fd67fd18ffc6052eb88fcec5bc7b40..3e75648a444b65f8d58419185ef005959b285a93 100644 (file)
       to: 'on'\r
 \r
   action:\r
-    service: script.notify_text\r
-    data_template:\r
-      title: "Home Assistant - Aggiornamento"\r
-      message: "E' disponibile un aggiornamento per Home Assistant {{ state_attr('binary_sensor.updater', 'newest_version') }}. {{now().strftime('%Y-%m-%d %I:%M %p')}}"\r
-      notification_id: "update"\r
-      enable_persistent: 1\r
+    - service: script.notify_text\r
+      data_template:\r
+        title: "Home Assistant - Aggiornamento"\r
+        message: "E' disponibile un aggiornamento per Home Assistant {{ state_attr('binary_sensor.updater', 'newest_version') }}. {{now().strftime('%Y-%m-%d %I:%M %p')}}"\r
+        notification_id: "update"\r
+        enable_persistent: 1\r
+    \r
+    - service: input_boolean.turn_on\r
+      entity_id: input_boolean.update\r
 \r
 ######################################################################\r
 # Update Notification: Shelly\r
       to: 'on'\r
 \r
   action:\r
-    service: script.notify_text\r
-    data_template:\r
-      title: "Shelly - Aggiornamento"\r
-      message: "Sono disponibili aggiornamenti per i dispositivi Shelly"\r
-      notification_id: "update"\r
-      enable_persistent: 1\r
+    - service: script.notify_text\r
+      data_template:\r
+        title: "Shelly - Aggiornamento"\r
+        message: "Sono disponibili aggiornamenti per i dispositivi Shelly"\r
+        notification_id: "update"\r
+        enable_persistent: 1\r
+\r
+    - service: input_boolean.turn_on\r
+      entity_id: input_boolean.update\r
 \r
 ######################################################################\r
 # Update Notification: HACS\r
       above: 0\r
 \r
   action:\r
-    service: script.notify_text\r
-    data_template:\r
-      title: "HACS - Aggiornamento"\r
-      message: "Sono disponibili aggiornamenti per i moduli HACS"\r
-      notification_id: "update"\r
-      enable_persistent: 1\r
+    - service: script.notify_text\r
+      data_template:\r
+        title: "HACS - Aggiornamento"\r
+        message: "Sono disponibili aggiornamenti per i moduli HACS"\r
+        notification_id: "update"\r
+        enable_persistent: 1\r
+\r
+    - service: input_boolean.turn_on\r
+      entity_id: input_boolean.update\r
+\r
+######################################################################\r
+# Update: Aknowledge update\r
+#\r
+# Actions:\r
+# - persistent_notification.dismiss\r
+######################################################################\r
+- alias: "Update: Riconoscimento Aggiornamenti"\r
+  initial_state: 'on'\r
+\r
+  trigger:\r
+    platform: state\r
+    entity_id: input_boolean.update\r
+    to: 'off'\r
+\r
+  action:\r
+    - service: persistent_notification.dismiss\r
+      data_template:\r
+        notification_id: "update"\r
diff --git a/input_boolean/update.yaml b/input_boolean/update.yaml
new file mode 100644 (file)
index 0000000..677ed36
--- /dev/null
@@ -0,0 +1,8 @@
+######################################################################\r
+# Update: Generic \r
+######################################################################\r
+\r
+update:\r
+  name: Disponibilità Aggiornamenti\r
+  initial: off\r
+  icon: mdi:cellphone-arrow-down\r