Scriptable/Untitled Script 4.js
2024-09-18 14:27:22 +01:00

18 lines
No EOL
566 B
JavaScript

// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: purple; icon-glyph: magic;
const HASS_LLAT = Keychain.get("hass_llat");
const HASS_API_URL = "https://hass-new.adhd.energy/api";
async function fetchStates() {
var wordle_req = new Request(HASS_API_URL + "/states/sensor.aaron_wordle")
wordle_req.headers = {
"Authorization": "Bearer " + HASS_LLAT,
"Content-Type": "application/json"
}
console.log(wordle_req)
return await wordle_req.loadJSON();
}
console.log(fetchStates().response)