Skip to content

Commit

Permalink
Ignore update locallyControlled if configuration from server
Browse files Browse the repository at this point in the history
  • Loading branch information
pnt325 committed Mar 31, 2024
1 parent dc875dd commit adce439
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions examples/OneOpenAir/LocalConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,12 +267,15 @@ bool LocalConfig::parse(String data, bool isLocal) {
}
}

if (JSON.typeof_(root["locallyControlled"]) == "boolean") {
bool locallyControlled = root["locallyControlled"];
if (locallyControlled != config.locallyControlled) {
changed = true;
config.locallyControlled = locallyControlled;
printLog("set locallyControlled: " + String(locallyControlled));
/** This field only allow on local configure */
if (isLocal) {
if (JSON.typeof_(root["locallyControlled"]) == "boolean") {
bool locallyControlled = root["locallyControlled"];
if (locallyControlled != config.locallyControlled) {
changed = true;
config.locallyControlled = locallyControlled;
printLog("set locallyControlled: " + String(locallyControlled));
}
}
}

Expand Down

0 comments on commit adce439

Please sign in to comment.