Fixed #066 by moving notifications over to new today_is sensor

This commit is contained in:
Jeffrey Stone 2020-06-07 19:37:46 -04:00
parent d0cc31681e
commit 3172852885
1 changed files with 17 additions and 2 deletions

View File

@ -855,7 +855,7 @@ script:
Do not forget to make your beds! Do not forget to make your beds!
{% endif %} {% endif %}
{% if is_state('sensor.weekday', 'mon') %} {% if is_state('sensor.today_is', 'Monday') %}
{% if now().strftime('%H')|int > 17 %} {% if now().strftime('%H')|int > 17 %}
{{ [ 'Do not forget tomorrow is Trash Day. ', {{ [ 'Do not forget tomorrow is Trash Day. ',
'I advise you move the trash cans to the curb for the weekly pickup. ', 'I advise you move the trash cans to the curb for the weekly pickup. ',
@ -864,7 +864,7 @@ script:
{% endif %} {% endif %}
{% endif %} {% endif %}
{% if is_state('sensor.weekday', 'tue') %} {% if is_state('sensor.today_is', 'Tuesday') %}
{% if now().strftime('%H')|int > 17 %} {% if now().strftime('%H')|int > 17 %}
{{ [ 'Do not forget to bring in the trash cans. ', {{ [ 'Do not forget to bring in the trash cans. ',
'The trash cans will feel lonely if you leave them out all night. ', 'The trash cans will feel lonely if you leave them out all night. ',
@ -1121,6 +1121,12 @@ script:
] | random }} ] | random }}
{%- endmacro -%} {%- endmacro -%}
{%- macro launch() -%}
{{ [
'I have detected a rather large rocket preparing to take off.'
] | random }}
{%- endmacro -%}
{# a macro that removes all newline characters, empty spaces, and returns formatted text #} {# a macro that removes all newline characters, empty spaces, and returns formatted text #}
{%- macro cleanup(data) -%} {%- macro cleanup(data) -%}
{%- for item in data.split("\n") if item | trim != "" -%} {%- for item in data.split("\n") if item | trim != "" -%}
@ -1319,8 +1325,17 @@ script:
{% if call_snark_door_open == 1 %} {% if call_snark_door_open == 1 %}
{{ snark_door_open() }} {{ snark_door_open() }}
{% endif %} {% endif %}
{% if call_launch == 1 %}
{{ launch() }}
{% endif %}
{%- endmacro -%} {%- endmacro -%}
{{- cleanup(mother_of_all_macros()) -}} {{- cleanup(mother_of_all_macros()) -}}
############################################################################### ###############################################################################