diff --git a/src/WebDevicesService.cpp b/src/WebDevicesService.cpp index 0c6448645..e3410f5f1 100644 --- a/src/WebDevicesService.cpp +++ b/src/WebDevicesService.cpp @@ -45,7 +45,7 @@ void WebDevicesService::scan_devices(AsyncWebServerRequest * request) { } void WebDevicesService::all_devices(AsyncWebServerRequest * request) { - AsyncJsonResponse * response = new AsyncJsonResponse(false, EMSESP_MAX_JSON_SIZE_LARGE); + AsyncJsonResponse * response = new AsyncJsonResponse(false, EMSESP_MAX_JSON_SIZE_LARGE_DYN); JsonObject root = response->getRoot(); JsonArray devices = root.createNestedArray("devices"); @@ -80,7 +80,7 @@ void WebDevicesService::all_devices(AsyncWebServerRequest * request) { void WebDevicesService::device_data(AsyncWebServerRequest * request, JsonVariant & json) { if (json.is()) { - AsyncJsonResponse * response = new AsyncJsonResponse(false, EMSESP_MAX_JSON_SIZE_LARGE_DYN); + AsyncJsonResponse * response = new AsyncJsonResponse(false, EMSESP_MAX_JSON_SIZE_MAX_DYN); #ifndef EMSESP_STANDALONE uint8_t id = json["id"]; // get id from selected table row EMSESP::device_info_web(id, (JsonObject &)response->getRoot()); diff --git a/src/WebStatusService.cpp b/src/WebStatusService.cpp index dc812e499..cb1ed6976 100644 --- a/src/WebStatusService.cpp +++ b/src/WebStatusService.cpp @@ -57,7 +57,7 @@ void WebStatusService::onStationModeGotIP(const WiFiEventStationModeGotIP & even #endif void WebStatusService::webStatusService(AsyncWebServerRequest * request) { - AsyncJsonResponse * response = new AsyncJsonResponse(false, EMSESP_MAX_JSON_SIZE_LARGE); + AsyncJsonResponse * response = new AsyncJsonResponse(false, EMSESP_MAX_JSON_SIZE_MEDIUM_DYN); JsonObject root = response->getRoot(); root["status"] = EMSESP::bus_status(); // 0, 1 or 2 diff --git a/src/emsesp.cpp b/src/emsesp.cpp index 01dfb2ef6..b0e184788 100644 --- a/src/emsesp.cpp +++ b/src/emsesp.cpp @@ -264,7 +264,7 @@ void EMSESP::show_device_values(uuid::console::Shell & shell) { return; } - DynamicJsonDocument doc(EMSESP_MAX_JSON_SIZE_LARGE_DYN); + DynamicJsonDocument doc(EMSESP_MAX_JSON_SIZE_MAX_DYN); // do this in the order of factory classes to keep a consistent order when displaying for (const auto & device_class : EMSFactory::device_handlers()) { @@ -677,8 +677,8 @@ void EMSESP::device_info_web(const uint8_t unique_id, JsonObject & root) { for (const auto & emsdevice : emsdevices) { if (emsdevice) { if (emsdevice->unique_id() == unique_id) { - root["name"] = emsdevice->to_string_short(); // can't use c_str() because of scope - JsonArray data = root.createNestedArray("data"); + root["name"] = emsdevice->to_string_short(); // can't use c_str() because of scope + JsonArray data = root.createNestedArray("data"); emsdevice->device_info_web(data); return; } diff --git a/src/emsesp.h b/src/emsesp.h index c537c039e..4fc851b21 100644 --- a/src/emsesp.h +++ b/src/emsesp.h @@ -58,6 +58,7 @@ #define EMSESP_MAX_JSON_SIZE_LARGE 1024 // for large json docs from ems devices, like boiler or thermostat data, using StaticJsonDocument #define EMSESP_MAX_JSON_SIZE_MEDIUM_DYN 1024 // for large json docs, using DynamicJsonDocument #define EMSESP_MAX_JSON_SIZE_LARGE_DYN 2048 // for very large json docs, using DynamicJsonDocument +#define EMSESP_MAX_JSON_SIZE_MAX_DYN 4096 // for very very large json docs, using DynamicJsonDocument namespace emsesp {