From adce439ce76807732a9f71b1cdc90360224262cb Mon Sep 17 00:00:00 2001 From: Phat Nguyen Date: Sun, 31 Mar 2024 07:52:33 +0700 Subject: [PATCH] Ignore update `locallyControlled` if configuration from server --- examples/OneOpenAir/LocalConfig.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/examples/OneOpenAir/LocalConfig.cpp b/examples/OneOpenAir/LocalConfig.cpp index 5e1e76e2..ede12eea 100644 --- a/examples/OneOpenAir/LocalConfig.cpp +++ b/examples/OneOpenAir/LocalConfig.cpp @@ -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)); + } } }