Fix status endpoint and relay defaults

This commit is contained in:
2026-06-03 23:01:10 -06:00
parent 2b2bfa9bdc
commit 19e4d460a0
2 changed files with 8 additions and 4 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
struct RelayState { struct RelayState {
bool starlink = false; bool starlink = false;
bool fridge = true; bool fridge = false;
}; };
extern RelayState relays; extern RelayState relays;
@@ -175,9 +175,13 @@ void pollDashboardUart() {
} }
void handleStatus() { void handleStatus() {
server.setContentLength(CONTENT_LENGTH_UNKNOWN); DynamicJsonDocument doc(2048);
server.send(200, "application/json", ""); buildStatusDocument(doc);
sendStatus(server.client(), true);
String output;
serializeJson(doc, output);
server.send(200, "application/json", output);
} }
void handleRelayHttp(const char* relayName, bool enabled) { void handleRelayHttp(const char* relayName, bool enabled) {