hestia/src/assets/hestia.js

25 lines
820 B
JavaScript
Raw Normal View History

2024-08-14 23:02:03 +00:00
import { Communicator,State } from './HestiaClasses.js';
2024-08-14 23:00:58 +00:00
const psState = new State();
window.onload = function() {
refreshState(window.document);
};
function refreshState(doc) {
const igniterStatus = doc.getElementById("igniterStatus");
const exhaustStatus = doc.getElementById("exhaustStatus");
const augerStatus = doc.getElementById("augerStatus");
let statusString;
statusString = '';
if (psState.igniter.on) statusString = "On"; else statusString = "Off";
igniterStatus.innerHTML = statusString;
statusString = '';
if (psState.exhaust.on) statusString = "On"; else statusString = "Off";
exhaustStatus.innerHTML = statusString;
statusString = '';
if (psState.auger.on) statusString = "On"; else statusString = "Off";
augerStatus.innerHTML = statusString;
}