mqtt test fin

This commit is contained in:
derlole
2025-04-25 11:24:39 +00:00
parent f3ce1ea066
commit e838cba37f

View File

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