feat: persistent settings in LittleFS JSON

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-17 20:08:03 +07:00
co-authored by Claude Opus 4.8
parent 5c96cfc1f3
commit 4e53e7388f
3 changed files with 76 additions and 0 deletions
+9
View File
@@ -6,6 +6,7 @@
#include "rtc_time.h"
#include "forecast.h"
#include "history.h"
#include "app_settings.h"
static void i2cScan() {
Serial.println(F("I2C scan:"));
@@ -59,6 +60,14 @@ void setup() {
historyCount(), d, classifyTrend(d));
else
Serial.println(F("history: not enough data for trend"));
// --- settings self-test (remove after Task 8) ---
settingsBegin();
Serial.printf("settings: alt=%.0f tz=%d lat=%.4f lon=%.4f\n",
settings.altitudeM, settings.tzOffsetMin, settings.lat, settings.lon);
settings.altitudeM += 1.0f; // change and persist to test round-trip
settingsSave();
Serial.println(F("settings: incremented altitude and saved"));
}
void loop() {