Skip to content

Commit 2e4d889

Browse files
Update nixies on enabling autonomous mode
1 parent 2aab358 commit 2e4d889

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/system/nixie.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
bool nixieSetupComplete = false;
2626
bool nixieAutonomous = true;
27+
bool forceUpdate = true;
2728
bool cycleNixies = false;
2829
bool crypto = false;
2930

@@ -242,7 +243,6 @@ void taskUpdateNixie(void* parameter) {
242243
int lastMinute = 0;
243244
int lastHour = 0;
244245

245-
bool forceUpdate = true;
246246
cycleNixies = true;
247247

248248
Serial.println("[T] Nixie: Starting nixie updater...");

src/system/webServer.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -450,14 +450,14 @@ void webServerStartup() {
450450
}
451451

452452
// Write config.cfg
453-
if (InputValid) {
453+
if (InputValid && configUpdate) {
454454
File nixieConfig = LITTLEFS.open(F("/config/nixieConfig.json"), "w");
455455
if (!(serializeJson(tmpJSON, nixieConfig))) {
456456
Serial.println(F("[X] WebServer: Config write failure."));
457457
request->send(400, "application/json", "{\"status\": \"error\", \"message\": \"" + errMsg + "\"}");
458458
} else {
459459
if (crypto) nixieAutonomous = false;
460-
460+
461461
request->send(200, "application/json", "{\"status\": \"success\", \"message\": \"Nixie config has been updated.\"}");
462462
}
463463

@@ -481,6 +481,7 @@ void webServerStartup() {
481481

482482
} else if (!manual && !crypto) {
483483
nixieAutonomous = true;
484+
forceUpdate = true;
484485
request->send(200, "application/json", "{\"status\": \"success\", \"message\": \"Nixies now in autonomous mode.\"}");
485486

486487
} else {

0 commit comments

Comments
 (0)