Minor changes
This commit is contained in:
parent
53464acb22
commit
ceb80d8bd7
@ -287,7 +287,7 @@ void loadStatus(void)
|
|||||||
saveStatus();
|
saveStatus();
|
||||||
File file = LittleFS.open("/status.json", "r");
|
File file = LittleFS.open("/status.json", "r");
|
||||||
String jsonFile = file.readString();
|
String jsonFile = file.readString();
|
||||||
DynamicJsonDocument json(32);
|
DynamicJsonDocument json(64); // To calculate the buffer size uses https://arduinojson.org/v6/assistant.
|
||||||
deserializeJson(json, jsonFile);
|
deserializeJson(json, jsonFile);
|
||||||
relayStatus = json["status"];
|
relayStatus = json["status"];
|
||||||
file.close();
|
file.close();
|
||||||
@ -298,7 +298,7 @@ void loadStatus(void)
|
|||||||
void saveStatus(void)
|
void saveStatus(void)
|
||||||
{
|
{
|
||||||
ETS_GPIO_INTR_DISABLE();
|
ETS_GPIO_INTR_DISABLE();
|
||||||
DynamicJsonDocument json(32);
|
DynamicJsonDocument json(48); // To calculate the buffer size uses https://arduinojson.org/v6/assistant.
|
||||||
json["status"] = relayStatus;
|
json["status"] = relayStatus;
|
||||||
json["system"] = "empty";
|
json["system"] = "empty";
|
||||||
File file = LittleFS.open("/status.json", "w");
|
File file = LittleFS.open("/status.json", "w");
|
||||||
@ -340,7 +340,7 @@ void setupWebServer()
|
|||||||
webServer.on("/config", HTTP_GET, [](AsyncWebServerRequest *request)
|
webServer.on("/config", HTTP_GET, [](AsyncWebServerRequest *request)
|
||||||
{
|
{
|
||||||
String configJson;
|
String configJson;
|
||||||
DynamicJsonDocument json(512);
|
DynamicJsonDocument json(384); // To calculate the buffer size uses https://arduinojson.org/v6/assistant.
|
||||||
json["firmware"] = config.firmware;
|
json["firmware"] = config.firmware;
|
||||||
json["espnowNetName"] = config.espnowNetName;
|
json["espnowNetName"] = config.espnowNetName;
|
||||||
json["deviceName"] = config.deviceName;
|
json["deviceName"] = config.deviceName;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user