mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
FS_Buffer to 8k for customizations
This commit is contained in:
@@ -14,7 +14,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef FS_BUFFER_SIZE
|
#ifndef FS_BUFFER_SIZE
|
||||||
#define FS_BUFFER_SIZE 4096
|
#define FS_BUFFER_SIZE 8192
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
enum class StateUpdateResult {
|
enum class StateUpdateResult {
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef FS_BUFFER_SIZE
|
#ifndef FS_BUFFER_SIZE
|
||||||
#define FS_BUFFER_SIZE 4096
|
#define FS_BUFFER_SIZE 8192
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
enum class StateUpdateResult {
|
enum class StateUpdateResult {
|
||||||
|
|||||||
@@ -940,7 +940,7 @@ void System::extractSettings(const char * filename, const char * section, JsonOb
|
|||||||
#ifndef EMSESP_STANDALONE
|
#ifndef EMSESP_STANDALONE
|
||||||
File settingsFile = LittleFS.open(filename);
|
File settingsFile = LittleFS.open(filename);
|
||||||
if (settingsFile) {
|
if (settingsFile) {
|
||||||
DynamicJsonDocument jsonDocument = DynamicJsonDocument(EMSESP_JSON_SIZE_XLARGE_DYN);
|
DynamicJsonDocument jsonDocument = DynamicJsonDocument(FS_BUFFER_SIZE);
|
||||||
DeserializationError error = deserializeJson(jsonDocument, settingsFile);
|
DeserializationError error = deserializeJson(jsonDocument, settingsFile);
|
||||||
if (error == DeserializationError::Ok && jsonDocument.is<JsonObject>()) {
|
if (error == DeserializationError::Ok && jsonDocument.is<JsonObject>()) {
|
||||||
JsonObject jsonObject = jsonDocument.as<JsonObject>();
|
JsonObject jsonObject = jsonDocument.as<JsonObject>();
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ void WebAPIService::parse(AsyncWebServerRequest * request, JsonObject & input) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void WebAPIService::getSettings(AsyncWebServerRequest * request) {
|
void WebAPIService::getSettings(AsyncWebServerRequest * request) {
|
||||||
auto * response = new AsyncJsonResponse(false, EMSESP_JSON_SIZE_XLARGE_DYN);
|
auto * response = new AsyncJsonResponse(false, FS_BUFFER_SIZE);
|
||||||
JsonObject root = response->getRoot();
|
JsonObject root = response->getRoot();
|
||||||
|
|
||||||
root["type"] = "settings";
|
root["type"] = "settings";
|
||||||
@@ -179,7 +179,7 @@ void WebAPIService::getSettings(AsyncWebServerRequest * request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void WebAPIService::getCustomizations(AsyncWebServerRequest * request) {
|
void WebAPIService::getCustomizations(AsyncWebServerRequest * request) {
|
||||||
auto * response = new AsyncJsonResponse(false, EMSESP_JSON_SIZE_XLARGE_DYN);
|
auto * response = new AsyncJsonResponse(false, FS_BUFFER_SIZE);
|
||||||
JsonObject root = response->getRoot();
|
JsonObject root = response->getRoot();
|
||||||
|
|
||||||
root["type"] = "customizations";
|
root["type"] = "customizations";
|
||||||
|
|||||||
Reference in New Issue
Block a user