Skip to content

Commit 6b93648

Browse files
Copilotdorkmo
andcommitted
Remove unused /api/refresh endpoint and handleRefreshPost function
Co-authored-by: dorkmo <[email protected]>
1 parent 3edec7e commit 6b93648

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed

TankAlarm-112025-Viewer-BluesOpta/TankAlarm-112025-Viewer-BluesOpta.ino

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,6 @@ static double computeNextAlignedEpoch(double epoch, uint8_t baseHour, uint32_t i
390390
static void scheduleNextSummaryFetch();
391391
static void fetchViewerSummary();
392392
static void handleViewerSummary(JsonDocument &doc, double epoch);
393-
static void handleRefreshPost(EthernetClient &client, const String &body);
394393

395394
void setup() {
396395
Serial.begin(115200);
@@ -575,8 +574,6 @@ static void handleWebRequests() {
575574
sendDashboard(client);
576575
} else if (method == "GET" && path == "/api/tanks") {
577576
sendTankJson(client);
578-
} else if (method == "POST" && path == "/api/refresh") {
579-
handleRefreshPost(client, body);
580577
} else {
581578
respondStatus(client, 404, "Not Found");
582579
}
@@ -835,27 +832,3 @@ static void handleViewerSummary(JsonDocument &doc, double epoch) {
835832
Serial.print(gTankRecordCount);
836833
Serial.println(F(" tanks)"));
837834
}
838-
839-
static void handleRefreshPost(EthernetClient &client, const String &body) {
840-
char clientUid[48] = {0};
841-
if (body.length() > 0) {
842-
DynamicJsonDocument doc(128);
843-
if (deserializeJson(doc, body) == DeserializationError::Ok) {
844-
const char *uid = doc["client"] | "";
845-
if (uid && *uid) {
846-
strlcpy(clientUid, uid, sizeof(clientUid));
847-
}
848-
}
849-
}
850-
851-
if (clientUid[0]) {
852-
Serial.print(F("Viewer manual refresh requested for client " ));
853-
Serial.println(clientUid);
854-
} else {
855-
Serial.println(F("Viewer manual refresh requested for all sites"));
856-
}
857-
858-
fetchViewerSummary();
859-
scheduleNextSummaryFetch();
860-
sendTankJson(client);
861-
}

0 commit comments

Comments
 (0)