users are manipulating the DPL using HTTP POST requests. often they are requesting the current settings using HTTP GET on the respective route, then change a particular settings, and send all the data back using HTTP POST. if they failed to remove the metadata node from the JSON, OpenDTU-OnBattery would not be able to process the JSON due to its size. the web app does not submit the metadata. to avoid problems, the metadata is now split from the configuration data.
19 lines
485 B
C++
19 lines
485 B
C++
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
#pragma once
|
|
|
|
#include <ESPAsyncWebServer.h>
|
|
#include <TaskSchedulerDeclarations.h>
|
|
|
|
|
|
class WebApiPowerLimiterClass {
|
|
public:
|
|
void init(AsyncWebServer& server, Scheduler& scheduler);
|
|
|
|
private:
|
|
void onStatus(AsyncWebServerRequest* request);
|
|
void onMetaData(AsyncWebServerRequest* request);
|
|
void onAdminGet(AsyncWebServerRequest* request);
|
|
void onAdminPost(AsyncWebServerRequest* request);
|
|
|
|
AsyncWebServer* _server;
|
|
}; |