Unaccessible wsec.json and preset loading fix

This commit is contained in:
cschwinne
2020-11-09 11:09:47 +01:00
parent 1f42070104
commit 7f973ad131
5 changed files with 22 additions and 7 deletions

View File

@@ -18,7 +18,7 @@ bool applyPreset(byte index)
DEBUGFS_PRINTLN(F("Make read buf"));
DynamicJsonDocument fDoc(JSON_BUFFER_SIZE);
errorFlag = readObjectFromFileUsingId("/presets.json", index, &fDoc) ? ERR_NONE : ERR_FS_PLOAD;
JsonObject fdo = fileDoc->as<JsonObject>();
JsonObject fdo = fDoc.as<JsonObject>();
if (fdo["ps"] == index) fdo.remove("ps");
#ifdef WLED_DEBUG_FS
serializeJson(fDoc, Serial);