This commit is contained in:
@@ -177,10 +177,10 @@
|
|||||||
const now = Date.now();
|
const now = Date.now();
|
||||||
if (data.button === "stop1" && status1 === "running") {
|
if (data.button === "stop1" && status1 === "running") {
|
||||||
timer1 += (now - lastSync) / 1000;
|
timer1 += (now - lastSync) / 1000;
|
||||||
status1 = "stopped";
|
status1 = "finished";
|
||||||
} else if (data.button === "stop2" && status2 === "running") {
|
} else if (data.button === "stop2" && status2 === "running") {
|
||||||
timer2 += (now - lastSync) / 1000;
|
timer2 += (now - lastSync) / 1000;
|
||||||
status2 = "stopped";
|
status2 = "finished";
|
||||||
}
|
}
|
||||||
kickDisplayScheduler();
|
kickDisplayScheduler();
|
||||||
syncFromBackend();
|
syncFromBackend();
|
||||||
@@ -820,14 +820,19 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const validStatuses = ["ready", "running", "finished", "armed"];
|
||||||
|
|
||||||
function syncFromBackend() {
|
function syncFromBackend() {
|
||||||
fetch("/api/data")
|
fetch("/api/data")
|
||||||
.then((response) => response.json())
|
.then((response) => response.json())
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
timer1 = data.time1;
|
timer1 = data.time1;
|
||||||
timer2 = data.time2;
|
timer2 = data.time2;
|
||||||
status1 = data.status1;
|
// Status nur übernehmen, wenn der Wert gültig ist.
|
||||||
status2 = data.status2;
|
// Bei unvollständiger ESP-Response (Last) bleibt der
|
||||||
|
// bisherige Status erhalten statt "Status unbekannt".
|
||||||
|
if (validStatuses.includes(data.status1)) status1 = data.status1;
|
||||||
|
if (validStatuses.includes(data.status2)) status2 = data.status2;
|
||||||
best1 = data.best1;
|
best1 = data.best1;
|
||||||
best2 = data.best2;
|
best2 = data.best2;
|
||||||
learningMode = data.learningMode;
|
learningMode = data.learningMode;
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
#include <webserverrouter.h>
|
#include <webserverrouter.h>
|
||||||
#include <wificlass.h>
|
#include <wificlass.h>
|
||||||
|
|
||||||
const char *firmwareversion = "1.1.0"; // Version der Firmware
|
const char *firmwareversion = "1.1.1"; // Version der Firmware
|
||||||
|
|
||||||
// moved to preferencemanager.h
|
// moved to preferencemanager.h
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user