From 6987313cbcada273e3bd47550adfd8e2086d56dc Mon Sep 17 00:00:00 2001 From: ccostan Date: Mon, 21 Oct 2019 17:42:01 -0400 Subject: [PATCH] #288 Updated some of the static Holidays using Command Line --- config/packages/holiday.yaml | 14 ++++++-------- config/travis_secrets.yaml | 2 -- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/config/packages/holiday.yaml b/config/packages/holiday.yaml index 959027f8..a7415dbf 100755 --- a/config/packages/holiday.yaml +++ b/config/packages/holiday.yaml @@ -63,18 +63,16 @@ sensor: # Countdown Sesor using WolfRam Alpha Natural language queries ################################################################################ - - platform: rest + - platform: command_line name: Halloween Countdown - resource: !secret wolframalpha_halloween_api - value_template: "{{ (value|replace(' days', '')) | int }}" + command: "HALLOWEEN=`date -d 'Oct 31' +%j | awk '{print $1 + 0}'`; TODAY=`date +%j | awk '{print $1 + 0}'`; DAYS=$(($HALLOWEEN - $TODAY)); echo $DAYS" unit_of_measurement: Days scan_interval: 43200 - - platform: rest - name: Christams Countdown - resource: !secret wolframalpha_xmas_api - value_template: "{{ (value|replace(' days', '')) | int }}" - unit_of_measurement: Days + - platform: command_line + command: "XMAS=`date -d 'Dec 25' +%j | awk '{print $1 + 0}'`; TODAY=`date +%j | awk '{print $1 + 0}'`; DAYS=$(($XMAS - $TODAY)); echo $DAYS" + name: Christmas Countdown + unit_of_measurement: days scan_interval: 43200 - platform: rest diff --git a/config/travis_secrets.yaml b/config/travis_secrets.yaml index ae4bf487..fd1ad39e 100755 --- a/config/travis_secrets.yaml +++ b/config/travis_secrets.yaml @@ -73,8 +73,6 @@ cloud_user_pool: 'SuperSecretPlace' cloud_relayer: 'SuperSecretWebThingy' vantage_api: LONGAPIKEYFORFREE minecraft: private_server.com -wolframalpha_halloween_api: https://api.wolframalpha.com/v2/result?appid=JIUY8U-4V8KY45VT1&i=How%20many%20days%20until%20halloween -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