Ignore update locallyControlled if configuration from server

This commit is contained in:
Phat Nguyen
2024-03-31 07:52:33 +07:00
parent dc875dd5a8
commit adce439ce7

View File

@ -267,6 +267,8 @@ bool LocalConfig::parse(String data, bool isLocal) {
} }
} }
/** This field only allow on local configure */
if (isLocal) {
if (JSON.typeof_(root["locallyControlled"]) == "boolean") { if (JSON.typeof_(root["locallyControlled"]) == "boolean") {
bool locallyControlled = root["locallyControlled"]; bool locallyControlled = root["locallyControlled"];
if (locallyControlled != config.locallyControlled) { if (locallyControlled != config.locallyControlled) {
@ -275,6 +277,7 @@ bool LocalConfig::parse(String data, bool isLocal) {
printLog("set locallyControlled: " + String(locallyControlled)); printLog("set locallyControlled: " + String(locallyControlled));
} }
} }
}
/** Parse data only got from AirGradient server */ /** Parse data only got from AirGradient server */
if (isLocal == false) { if (isLocal == false) {