From: Giorgio Ravera Date: Sun, 24 Feb 2019 20:03:28 +0000 (+0100) Subject: Minor fix to notify script X-Git-Url: http://git.giorgioravera.it/?a=commitdiff_plain;h=e79242020ce610380a87afbd25941dd85534100d;p=homeassistant.git Minor fix to notify script --- diff --git a/automation/welcome.yaml b/automation/welcome.yaml index e0a6bc7e..c943b2c6 100644 --- a/automation/welcome.yaml +++ b/automation/welcome.yaml @@ -84,6 +84,7 @@ {%- endmacro -%} {{ greeting_sentence(name) }} + enable_greeting: 0 - service: input_boolean.turn_off data: diff --git a/script/notify.yaml b/script/notify.yaml index 0597ef7b..4d0a932f 100644 --- a/script/notify.yaml +++ b/script/notify.yaml @@ -26,8 +26,12 @@ notify_text_internal: - condition: template value_template: > - {% if enable_persistent | int == 1 %} - true + {% if enable_persistent | length != 0 %} + {% if enable_persistent | int == 1 %} + true + {% else %} + false + {% endif %} {% else %} false {% endif %} diff --git a/script/speech_engine.yaml b/script/speech_engine.yaml index 9794ed80..58ff3058 100644 --- a/script/speech_engine.yaml +++ b/script/speech_engine.yaml @@ -19,16 +19,18 @@ speech_engine: volume_level: "{{ volume_level }}" language: "{{ language }}" message: >- - {# greeting message #} - {% if enable_greeting | int == 1 %} - {% if now().strftime('%H')|int >= 7 and now().strftime('%H')|int < 12 %} - Buongiorno. - {% elif now().strftime('%H')|int >= 12 and now().strftime('%H')|int < 17 %} - Buonpomeriggio. - {% elif now().strftime('%H')|int >= 17 and now().strftime('%H')|int < 23 %} - Buonasera. - {% else %} - Buonanotte. + {# greeting message #} + {% if enable_greeting | length != 0 %} + {% if enable_greeting | int == 1 %} + {% if now().strftime('%H')|int >= 7 and now().strftime('%H')|int < 12 %} + Buongiorno. + {% elif now().strftime('%H')|int >= 12 and now().strftime('%H')|int < 17 %} + Buonpomeriggio. + {% elif now().strftime('%H')|int >= 17 and now().strftime('%H')|int < 23 %} + Buonasera. + {% else %} + Buonanotte. + {% endif %} {% endif %} {% endif %}