mqtt test v4.3 (with web)

This commit is contained in:
derlole
2025-04-25 10:55:02 +00:00
parent 2563876144
commit f3ce1ea066
2 changed files with 7 additions and 1 deletions

View File

@@ -80,7 +80,12 @@
fetch('/unsecure/esp/toggle-machine', { method: 'POST' })
.then(res => res.json())
.then(data => {
document.getElementById("machine-status").innerText = data.status;
console.log(data);
if (data.command === 'machineToggle') {
document.getElementById("machine-status").innerText = "PENDING";
} else {
document.getElementById("machine-status").innerText = "SOME_ERR";
}
});
}
</script>