1
0
mirror of https://github.com/s00500/ESPUI.git synced 2025-07-04 01:00:19 +00:00

#63 Add variables for jsonDynamicDocument Sizes

This commit is contained in:
2019-12-27 16:27:42 +01:00
parent 0323920a0d
commit fe45ed8010
3 changed files with 9 additions and 5 deletions

View File

@ -480,7 +480,7 @@ void ESPUIClass::updateControl(Control *control, int clientId) {
}
String json;
DynamicJsonDocument document(2000);
DynamicJsonDocument document(jsonUpdateDocumentSize);
JsonObject root = document.to<JsonObject>();
root["type"] = (int)control->type + ControlType::UpdateOffset;
@ -578,7 +578,7 @@ void ESPUIClass::addGraphPoint(uint16_t id, int nValue, int clientId) {
}
String json;
DynamicJsonDocument document(2000);
DynamicJsonDocument document(jsonUpdateDocumentSize);
JsonObject root = document.to<JsonObject>();
root["type"] = (int)ControlType::GraphPoint;
@ -622,7 +622,7 @@ sent as one blob at the beginning. Therefore a new type is used as well
*/
void ESPUIClass::jsonDom(AsyncWebSocketClient *client) {
String json;
DynamicJsonDocument document(4000);
DynamicJsonDocument document(jsonInitialDocumentSize);
document["type"] = (int)UI_INITIAL_GUI;
JsonArray items = document.createNestedArray("controls");