Add UI logic to hide ArduinoOTA checkbox and remove configuration items

This commit is contained in:
Blaž Kristan
2025-04-20 11:44:26 +02:00
parent ca7d7d9369
commit 8baf0fdef7
5 changed files with 19 additions and 1 deletions

View File

@@ -611,7 +611,9 @@ bool deserializeConfig(JsonObject doc, bool fromFS) {
if (pwdCorrect) { //only accept these values from cfg.json if ota is unlocked (else from wsec.json)
CJSON(otaLock, ota[F("lock")]);
CJSON(wifiLock, ota[F("lock-wifi")]);
#ifndef WLED_DISABLE_OTA
CJSON(aOtaEnabled, ota[F("aota")]);
#endif
getStringFromJson(otaPass, pwd, 33); //normally not present due to security
}
@@ -1103,7 +1105,9 @@ void serializeConfig(JsonObject root) {
ota[F("lock")] = otaLock;
ota[F("lock-wifi")] = wifiLock;
ota[F("pskl")] = strlen(otaPass);
#ifndef WLED_DISABLE_OTA
ota[F("aota")] = aOtaEnabled;
#endif
#ifdef WLED_ENABLE_DMX
JsonObject dmx = root.createNestedObject("dmx");
@@ -1174,7 +1178,9 @@ bool deserializeConfigSec() {
getStringFromJson(otaPass, ota[F("pwd")], 33);
CJSON(otaLock, ota[F("lock")]);
CJSON(wifiLock, ota[F("lock-wifi")]);
#ifndef WLED_DISABLE_OTA
CJSON(aOtaEnabled, ota[F("aota")]);
#endif
releaseJSONBufferLock();
return true;
@@ -1214,7 +1220,9 @@ void serializeConfigSec() {
ota[F("pwd")] = otaPass;
ota[F("lock")] = otaLock;
ota[F("lock-wifi")] = wifiLock;
#ifndef WLED_DISABLE_OTA
ota[F("aota")] = aOtaEnabled;
#endif
File f = WLED_FS.open(FPSTR(s_wsec_json), "w");
if (f) serializeJson(root, f);