]> git.giorgioravera.it Git - homeassistant.git/commitdiff
Minor fix to notify script
authorGiorgio Ravera <giorgio.ravera@gmail.com>
Sun, 24 Feb 2019 20:03:28 +0000 (21:03 +0100)
committerGiorgio Ravera <giorgio.ravera@gmail.com>
Sun, 24 Feb 2019 20:03:28 +0000 (21:03 +0100)
automation/welcome.yaml
script/notify.yaml
script/speech_engine.yaml

index e0a6bc7e4ff58e3b93ba6487316011bccb0ead45..c943b2c62637926e873507e3714234e4cc9a61be 100644 (file)
@@ -84,6 +84,7 @@
           {%- endmacro -%}
 
           {{ greeting_sentence(name) }}
+        enable_greeting: 0
 
     - service: input_boolean.turn_off
       data:
index 0597ef7bcd0cebd1ece30d5bb3ec23a91f21f16f..4d0a932f9857e3bfa1aa949f1bc2fb5422379b7c 100644 (file)
@@ -26,8 +26,12 @@ notify_text_internal:
 \r
     - condition: template\r
       value_template: >\r
-        {% if enable_persistent | int == 1 %}\r
-          true\r
+        {% if enable_persistent | length != 0 %}\r
+          {% if enable_persistent | int == 1 %}\r
+            true\r
+          {% else %}\r
+            false\r
+          {% endif %}\r
         {% else %}\r
           false\r
         {% endif %}\r
index 9794ed80036fd6a3f46d297dff80619ade303751..58ff3058ffc6b6faea5383fefa099853665bd2c3 100644 (file)
@@ -19,16 +19,18 @@ speech_engine:
         volume_level: "{{ volume_level }}"\r
         language: "{{ language }}"\r
         message: >-\r
-          {# greeting message #}    \r
-          {% if enable_greeting | int == 1 %}\r
-            {% if now().strftime('%H')|int >= 7 and now().strftime('%H')|int < 12 %}\r
-              Buongiorno.\r
-            {% elif now().strftime('%H')|int >= 12 and now().strftime('%H')|int < 17 %}\r
-              Buonpomeriggio.\r
-            {% elif now().strftime('%H')|int >= 17 and now().strftime('%H')|int < 23 %}\r
-              Buonasera.\r
-            {% else %}\r
-              Buonanotte.\r
+          {# greeting message #}\r
+          {% if enable_greeting | length != 0 %}\r
+            {% if enable_greeting | int == 1 %}\r
+              {% if now().strftime('%H')|int >= 7 and now().strftime('%H')|int < 12 %}\r
+                Buongiorno.\r
+              {% elif now().strftime('%H')|int >= 12 and now().strftime('%H')|int < 17 %}\r
+                Buonpomeriggio.\r
+              {% elif now().strftime('%H')|int >= 17 and now().strftime('%H')|int < 23 %}\r
+                Buonasera.\r
+              {% else %}\r
+                Buonanotte.\r
+              {% endif %}\r
             {% endif %}\r
           {% endif %}\r
           \r