From 31728528852b5f47162d07cd7b4e0f15b9c44545 Mon Sep 17 00:00:00 2001 From: Jeffrey Stone Date: Sun, 7 Jun 2020 19:37:46 -0400 Subject: [PATCH] Fixed #066 by moving notifications over to new today_is sensor --- config/packages/notify.yaml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/config/packages/notify.yaml b/config/packages/notify.yaml index b38466a..fb6c36e 100755 --- a/config/packages/notify.yaml +++ b/config/packages/notify.yaml @@ -855,7 +855,7 @@ script: Do not forget to make your beds! {% endif %} - {% if is_state('sensor.weekday', 'mon') %} + {% if is_state('sensor.today_is', 'Monday') %} {% if now().strftime('%H')|int > 17 %} {{ [ 'Do not forget tomorrow is Trash Day. ', 'I advise you move the trash cans to the curb for the weekly pickup. ', @@ -864,7 +864,7 @@ script: {% endif %} {% endif %} - {% if is_state('sensor.weekday', 'tue') %} + {% if is_state('sensor.today_is', 'Tuesday') %} {% if now().strftime('%H')|int > 17 %} {{ [ 'Do not forget to bring in the trash cans. ', 'The trash cans will feel lonely if you leave them out all night. ', @@ -1121,6 +1121,12 @@ script: ] | random }} {%- 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 #} {%- macro cleanup(data) -%} {%- for item in data.split("\n") if item | trim != "" -%} @@ -1319,8 +1325,17 @@ script: {% if call_snark_door_open == 1 %} {{ snark_door_open() }} {% endif %} + + {% if call_launch == 1 %} + {{ launch() }} + {% endif %} + + {%- endmacro -%} + + + {{- cleanup(mother_of_all_macros()) -}} ###############################################################################