From fed9d23ed81dbe87bfd72cd842a3c5e27dade37d Mon Sep 17 00:00:00 2001 From: Tyler Perkins Date: Fri, 28 Jan 2022 17:31:26 -0500 Subject: [PATCH] Add home assistant test script --- .gitignore | 3 +++ tests/getHA.sh | 10 ++++++++++ 2 files changed, 13 insertions(+) create mode 100755 tests/getHA.sh diff --git a/.gitignore b/.gitignore index ec7c31d..4b6e108 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,6 @@ src/config.hpp #ignore wifi image img/wifi.png + +#ignore json in tests +tests/*.json diff --git a/tests/getHA.sh b/tests/getHA.sh new file mode 100755 index 0000000..870bda1 --- /dev/null +++ b/tests/getHA.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +API_KEY=$(pass gluttony/homeassistant/API) +IP_ADDR="192.168.1.104" + +curl -X GET \ + -H "Authorization: Bearer $API_KEY" \ + -H "Content-Type: application/json" \ + -o out.json \ + http://$IP_ADDR:8123/api/states