forked from btclock/btclock_v3
Fix lost data connection detection
This commit is contained in:
parent
9cb4b97146
commit
e4a39de5fc
9 changed files with 80 additions and 10 deletions
|
@ -24,6 +24,10 @@ void setupWebserver() {
|
|||
|
||||
server.on("/api/full_refresh", HTTP_GET, onApiFullRefresh);
|
||||
|
||||
server.on("/api/stop_datasources", HTTP_GET, onApiStopDataSources);
|
||||
server.on("/api/restart_datasources", HTTP_GET, onApiRestartDataSources);
|
||||
|
||||
|
||||
server.on("/api/action/pause", HTTP_GET, onApiActionPause);
|
||||
server.on("/api/action/timer_restart", HTTP_GET, onApiActionTimerRestart);
|
||||
|
||||
|
@ -694,6 +698,28 @@ void onApiLightsStatus(AsyncWebServerRequest *request) {
|
|||
request->send(response);
|
||||
}
|
||||
|
||||
void onApiStopDataSources(AsyncWebServerRequest *request) {
|
||||
AsyncResponseStream *response =
|
||||
request->beginResponseStream("application/json");
|
||||
|
||||
stopPriceNotify();
|
||||
stopBlockNotify();
|
||||
|
||||
request->send(response);
|
||||
}
|
||||
|
||||
void onApiRestartDataSources(AsyncWebServerRequest *request) {
|
||||
AsyncResponseStream *response =
|
||||
request->beginResponseStream("application/json");
|
||||
|
||||
stopPriceNotify();
|
||||
stopBlockNotify();
|
||||
setupPriceNotify();
|
||||
setupBlockNotify();
|
||||
|
||||
request->send(response);
|
||||
}
|
||||
|
||||
void onApiLightsOff(AsyncWebServerRequest *request) {
|
||||
setLights(0, 0, 0);
|
||||
request->send(200);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue