-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add settings and OTA lock state to info #4279
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -802,6 +802,8 @@ void serializeInfo(JsonObject root) | |
os += 0x40; | ||
#endif | ||
|
||
root[F("settingsLocked")] = !correctPIN; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A shorter text would be preferrable to reduce flash usage. |
||
|
||
//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; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IMO the if enclosing is enough (and its bitfield of options). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As the docs do not explain how you read this info out of that field, can you at least explain here how to read that value |
||
#endif | ||
root[F("opt")] = os; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you think it is really necessart to broadcast state/info after settings are saved? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes it is. If this PR is that you know if the settings value, then you need to send the new value when you save There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indeed, it would allow an app using websockets to update its state right away |
||
stateChanged = true; | ||
} | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing |
||
} | ||
|
||
// reconnect WiFi to clear stale allocations if heap gets too low | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think it is necessary to add this here as cfg is only read at boot time.