diff --git a/wled00/cfg.cpp b/wled00/cfg.cpp index 3f6cfbacb6..edeef04ed3 100644 --- a/wled00/cfg.cpp +++ b/wled00/cfg.cpp @@ -643,6 +643,8 @@ bool deserializeConfig(JsonObject doc, bool fromFS) { CJSON(wifiLock, ota[F("lock-wifi")]); CJSON(aOtaEnabled, ota[F("aota")]); getStringFromJson(otaPass, pwd, 33); //normally not present due to security + interfaceUpdateCallMode = CALL_MODE_WS_SEND; + stateChanged = true; } #ifdef WLED_ENABLE_DMX diff --git a/wled00/json.cpp b/wled00/json.cpp index 288059653f..97d1033132 100644 --- a/wled00/json.cpp +++ b/wled00/json.cpp @@ -802,6 +802,8 @@ void serializeInfo(JsonObject root) os += 0x40; #endif + root[F("settingsLocked")] = !correctPIN; + //os += 0x20; // indicated now removed Blynk support, may be reused to indicate another build-time option #ifdef USERMOD_CRONIXIE @@ -818,6 +820,7 @@ void serializeInfo(JsonObject root) #endif #ifndef WLED_DISABLE_OTA os += 0x01; + root[F("otaLocked")] = otaLock; #endif root[F("opt")] = os; diff --git a/wled00/set.cpp b/wled00/set.cpp index 712e5f254a..e22272d27f 100644 --- a/wled00/set.cpp +++ b/wled00/set.cpp @@ -587,6 +587,8 @@ void handleSettingsSet(AsyncWebServerRequest *request, byte subPage) wifiLock = request->hasArg(F("OW")); aOtaEnabled = request->hasArg(F("AO")); //createEditHandler(correctPIN && !otaLock); + interfaceUpdateCallMode = CALL_MODE_WS_SEND; + stateChanged = true; } } diff --git a/wled00/util.cpp b/wled00/util.cpp index 0b78a46469..c2c0359868 100644 --- a/wled00/util.cpp +++ b/wled00/util.cpp @@ -355,7 +355,11 @@ void checkSettingsPIN(const char* pin) { if (!correctPIN && millis() - lastEditTime < PIN_RETRY_COOLDOWN) return; // guard against PIN brute force bool correctBefore = correctPIN; correctPIN = (strlen(settingsPIN) == 0 || strncmp(settingsPIN, pin, 4) == 0); - if (correctBefore != correctPIN) createEditHandler(correctPIN); + if (correctBefore != correctPIN) { + createEditHandler(correctPIN); + interfaceUpdateCallMode = CALL_MODE_WS_SEND; + stateChanged = true; + } lastEditTime = millis(); } diff --git a/wled00/wled.cpp b/wled00/wled.cpp index d6a39a399f..2629f756b4 100644 --- a/wled00/wled.cpp +++ b/wled00/wled.cpp @@ -155,6 +155,7 @@ void WLED::loop() if (strlen(settingsPIN)>0 && correctPIN && millis() - lastEditTime > PIN_TIMEOUT) { correctPIN = false; createEditHandler(false); + interfaceUpdateCallMode = CALL_MODE_WS_SEND; // schedule WS update } // reconnect WiFi to clear stale allocations if heap gets too low