Skip to content

Commit 5225b60

Browse files
committed
Bump asyncwebserverutils.
Also allow to override events json size
1 parent 0fe5618 commit 5225b60

File tree

5 files changed

+9
-6
lines changed

5 files changed

+9
-6
lines changed

platformio.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ lib_deps =
1717
Wire
1818
SPI
1919
https://github.com/GuLinux/AsyncBufferedTcpLogger#v0.0.5
20-
https://github.com/GuLinux/AsyncWebserverUtils#v0.0.6
20+
https://github.com/GuLinux/AsyncWebserverUtils#v0.1.0
2121
https://github.com/GuLinux/WiFiManager.git#v0.0.4
2222
https://github.com/GuLinux/ArduinoOTA-Manager.git#v0.0.2
2323
ESP32Async/AsyncTCP@^3.3.8

src/configuration.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333

3434
#define APB_INA1219_ADDRESS 0x40
3535

36+
#define MAX_EVENTS_SIZE 800
37+
3638
#if __has_include ("configuration_custom.h")
3739
#include "configuration_custom.h"
3840
#endif

src/main.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ void setup() {
4949
delay(BOOT_DELAY);
5050
#endif
5151

52+
5253
bufferedLogger.setup();
5354
Log.begin(LOG_LEVEL_VERBOSE, &Serial, true);
5455
Log.addHandler(&bufferedLogger);

src/webserver.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include <AsyncJson.h>
55
#include <ArduinoLog.h>
66
#include <forward_list>
7-
#include <validation.h>
7+
#include <webvalidation.h>
88
#include <jsonresponse.h>
99
#include "metricsresponse.h"
1010
#include <esp_system.h>
@@ -251,7 +251,7 @@ void APB::WebServer::onGetESPInfo(AsyncWebServerRequest *request) {
251251
}
252252

253253
void APB::WebServer::onPostSetHeater(AsyncWebServerRequest *request, JsonVariant &json) {
254-
Validation validation{request, json};
254+
WebValidation validation{request, json};
255255
if(validation.required<int>("index").required<const char*>("mode")
256256
.range("index", {0}, {Heaters::Instance.size()-1})
257257
.range("max_duty", {0}, {1})
@@ -293,7 +293,7 @@ void APB::WebServer::onPostSetHeater(AsyncWebServerRequest *request, JsonVariant
293293
}
294294

295295
void APB::WebServer::onConfigStatusLedDuty(AsyncWebServerRequest *request, JsonVariant &json) {
296-
Validation validation{request, json};
296+
WebValidation validation{request, json};
297297
if(validation.required<float>("duty")
298298
.range("duty", {0}, {1})
299299
.invalid()) return;
@@ -303,7 +303,7 @@ void APB::WebServer::onConfigStatusLedDuty(AsyncWebServerRequest *request, JsonV
303303
}
304304

305305
void APB::WebServer::onConfigPowerSourceType(AsyncWebServerRequest *request, JsonVariant &json) {
306-
Validation validation{request, json};
306+
WebValidation validation{request, json};
307307
std::forward_list<String> choices;
308308
std::map<String, PowerMonitor::PowerSource> mapping;
309309
std::for_each(

src/webserver.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class WebServer : public AsyncWebServerBase {
2525
AsyncEventSource events;
2626
Scheduler &scheduler;
2727
JsonDocument eventsDocument;
28-
std::array<char, 800> eventsString;
28+
std::array<char, MAX_EVENTS_SIZE> eventsString;
2929

3030
void onGetStatus(AsyncWebServerRequest *request);
3131
void onGetConfig(AsyncWebServerRequest *request);

0 commit comments

Comments
 (0)