Fix status endpoint and relay defaults
This commit is contained in:
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user