Skip to content

Instantly share code, notes, and snippets.

View malosaa's full-sized avatar
🏠
Partial working on a project (out of country)

Hector malosaa

🏠
Partial working on a project (out of country)
View GitHub Profile
@malosaa
malosaa / gauge.js
Last active July 13, 2023 17:30 — forked from m33x/gauge.js
Simple Home Assistant (HASS) iOS Gauge Lock Screen Widget via Scriptable App
// produce test `
const widget = new ListWidget();
// Get data from HASS
let result = await loadValues();
// Check data quality
let value = result.value;
let isValid = !Number.isNaN(value);
@malosaa
malosaa / hass.js
Created July 5, 2023 17:34 — forked from m33x/hass.js
Simple Home Assistant (HASS) iOS Widget via Scriptable App
let widget = await createWidget();
if (!config.runsInWidget) {
await widget.presentSmall();
}
Script.setWidget(widget);
Script.complete();
async function createWidget(items) {