From 83c040b800186da34c70f5812eb3cddd68a66bae Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Sat, 30 Nov 2024 17:30:03 -0500 Subject: [PATCH] Fix set feedrate --- src/assets/hestia.js | 11 ++++++++++- src/index.html | 30 ++++++++++++++---------------- 2 files changed, 24 insertions(+), 17 deletions(-) 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 @@
-
- -
- - -
-
- -
-
+ +
+ + +
+
+ +