We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9596b42 commit 89787e8Copy full SHA for 89787e8
source/lockscreen-homeassistant-temp.js
@@ -1,4 +1,21 @@
1
-.headers = { "Authorization": "Bearer YOUR KEY", "content-type": "application/json" }
+hass.js
2
+let widget = await createWidget();
3
+if (!config.runsInWidget) {
4
+ await widget.presentSmall();
5
+}
6
+
7
+Script.setWidget(widget);
8
+Script.complete();
9
10
+async function createWidget(items) {
11
12
+ /* Get data from API */
13
+ const tempImg = await getImage('temperature.png');
14
+ const humidImg = await getImage('humidity.png');
15
+ const logoImg = await getImage('hass-favicon.png');
16
17
+ let req = new Request("https://<HASS IP>/api/states")
18
+ req.headers = { "Authorization": "Bearer YOUR KEY", "content-type": "application/json" }
19
let json = await req.loadJSON();
20
21
/* Parse data received from API */
0 commit comments