feat: HTTP server with REST API for current/history/settings

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-17 21:15:16 +07:00
co-authored by Claude Opus 4.8
parent ea0256a5b9
commit 396688cd98
4 changed files with 96 additions and 0 deletions
+6
View File
@@ -8,6 +8,7 @@
#include "history.h"
#include "app_settings.h"
#include "net.h"
#include "web_server.h"
#include "state.h"
AppState g_state;
@@ -67,10 +68,15 @@ void setup() {
sampleNow();
historyAdd(rtcEpoch(), g_state.mslHpa, g_state.tempC);
displayRender(g_state);
webBegin();
if (netConnected()) Serial.printf("Web UI: http://%s/\n", netIP().c_str());
tSample = tHistory = tFlush = millis();
}
void loop() {
webLoop();
unsigned long now = millis();
if (now - tSample >= SAMPLE_INTERVAL_MS) {