From e59c99a4b70a36159cae7ccf050c0f64a60d77c9 Mon Sep 17 00:00:00 2001 From: ccostan Date: Sun, 6 Oct 2019 14:18:00 -0400 Subject: [PATCH] Additional update for FATHER'S Day #288. --- config/packages/holiday.yaml | 7 +++++++ config/templates/speech/briefing.yaml | 13 +++++++++++++ config/travis_secrets.yaml | 1 + 3 files changed, 21 insertions(+) diff --git a/config/packages/holiday.yaml b/config/packages/holiday.yaml index 1decf16f..a53d2892 100755 --- a/config/packages/holiday.yaml +++ b/config/packages/holiday.yaml @@ -90,6 +90,13 @@ sensor: value_template: "{{ (value|replace(' days', '')) | int }}" unit_of_measurement: Days scan_interval: 43200 + + - platform: rest + name: Father's Day Countdown + resource: !secret wolframalpha_fathersday_api + value_template: "{{ (value|replace(' days', '')) | int }}" + unit_of_measurement: Days + scan_interval: 43200 ############################################################################### # Automation that notifies of a Holiday "state" change ############################################################################### diff --git a/config/templates/speech/briefing.yaml b/config/templates/speech/briefing.yaml index 89729274..b18a0baa 100755 --- a/config/templates/speech/briefing.yaml +++ b/config/templates/speech/briefing.yaml @@ -121,6 +121,19 @@ {% endif %} {%- endmacro -%} + {%- macro days_until() -%} + {% set month=states("sensor.date").split('-')[1] | int %} + {%- if month == 5 -%} + There are {{ states.sensor.mothersday_countdown.state }} days until Mothers day! + {%- elif month == 6 -%} + There are {{ states.sensor.fathersday_countdown.state }} days until Fathers day! + {%- elif month == 10 -%} + There are {{ states.sensor.halloween_countdown.state }} days until Halloween! + {%- elif month == 12 -%} + There are {{ states.sensor.xmas_countdown.state }} days until Christmas! + {% endif %} + {%- endmacro -%} + {% macro inspirational_quote() %} {% set inspirational_quote = [ "and one more thing, Life is about making an impact, make it a positive one. ", diff --git a/config/travis_secrets.yaml b/config/travis_secrets.yaml index 9b6bea85..64cd208b 100755 --- a/config/travis_secrets.yaml +++ b/config/travis_secrets.yaml @@ -77,3 +77,4 @@ wolframalpha_halloween_api: https://api.wolframalpha.com/v2/result?appid=JIUY8U- wolframalpha_xmas_api: https://api.wolframalpha.com/v2/result?appid=JIUY8U-4V8KY45VT1&i=How%20many%20days%20until%20christmas wolframalpha_easter_api: https://api.wolframalpha.com/v2/result?appid=JIUY8U-4V8KY45VT1&i=How%20many%20days%20until%20easter wolframalpha_mothersday_api: https://api.wolframalpha.com/v2/result?appid=JIUY8U-4V8KY45VT1&i=How%20many%20days%20until%20mothers%20day +wolframalpha_fathersday_api: https://api.wolframalpha.com/v2/result?appid=JIUY8U-4V8KY45VT1&i=How%20many%20days%20until%20fathers%20day