Use auth token master
authorIgor Scheller <igor.scheller@igorshp.de>
Sun, 24 Mar 2019 13:43:56 +0000 (14:43 +0100)
committerIgor Scheller <igor.scheller@igorshp.de>
Sun, 24 Mar 2019 13:43:56 +0000 (14:43 +0100)
genslide.sh

index b83ff7f..08f19d1 100755 (executable)
@@ -86,8 +86,9 @@ test -f "$(numpath 12)" || convert -background black -fill '#ff6600' -pointsize
 
 ## SLIDE 9
 ## Always generate temperatue & humidity slide
-temp="$(curl -s 'http://hub.cccffm.space/api/states/sensor.temperature_lounge' | python -c 'import json; import sys; print json.loads(sys.stdin.read())["state"]')"
-humid="$(curl -s 'http://hub.cccffm.space/api/states/sensor.humidity_lounge' | python -c 'import json; import sys; print json.loads(sys.stdin.read())["state"]')"
+hass_token="eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiI5Njg0N2ZlNGIwMjQ0MWViYTc2ZTRiZWViZDRjZDAxNCIsImlhdCI6MTU1MzQzNDIxNCwiZXhwIjoxODY4Nzk0MjE0fQ.1fTNXVp55LqLziBZRP0LgMWk8bZhVReHHCJwMSgevR0"
+temp="$(curl -s -H "Authorization: Bearer ${hass_token}" 'http://hub.cccffm.space/api/states/sensor.temperature_lounge' | python -c 'import json; import sys; print json.loads(sys.stdin.read())["state"]')"
+humid="$(curl -s -H "Authorization: Bearer ${hass_token}" 'http://hub.cccffm.space/api/states/sensor.humidity_lounge' | python -c 'import json; import sys; print json.loads(sys.stdin.read())["state"]')"
 convert -background black -fill '#ff6600' -pointsize 64 -gravity center label:'Temperatur: '"${temp}°C"'\nrel. Feuchte: '"${humid}%" png:- | tmpwriter "$(numpath 9)"
 echo $(date +%s) $humitemp | tmpwriter "/dev/shm/humitemp.log"