diff --git a/src/assets/hestia.js b/src/assets/hestia.js index 072a5d4..7cd4709 100644 --- a/src/assets/hestia.js +++ b/src/assets/hestia.js @@ -26,6 +26,8 @@ const config = { const psState = new State(config); const comms = new Communicator(psState); +const setFeedRateButton = document.getElementById("set-feed-rate"); + export function refreshState(doc, state) { const igniterStatus = doc.getElementById("igniter-status"); const exhaustStatus = doc.getElementById("exhaust-status"); @@ -73,4 +75,11 @@ export function shutdown() { window.onload = function() { comms.init(psState, config); refreshState(window.document, psState); -}; \ No newline at end of file +}; + +setFeedRateButton.addEventListener("click", function() { + const feedRate = document.getElementById("feed-rate").value; + psState.auger.feedRate = feedRate; + comms.send(config.mqtt.topics.auger, JSON.stringify(psState.auger)); + refreshState(window.document, psState); +}); \ No newline at end of file diff --git a/src/index.html b/src/index.html index b489c70..42c16f3 100644 --- a/src/index.html +++ b/src/index.html @@ -72,22 +72,20 @@
- + +