mirror of
https://github.com/airgradienthq/arduino.git
synced 2025-07-04 19:56:31 +02:00
update log message and fix ledBarTestRequested
, co2CalibrationRequested
not execute
This commit is contained in:
@ -178,6 +178,8 @@ bool Configuration::begin(void) {
|
|||||||
* @return false Failure
|
* @return false Failure
|
||||||
*/
|
*/
|
||||||
bool Configuration::parse(String data, bool isLocal) {
|
bool Configuration::parse(String data, bool isLocal) {
|
||||||
|
logInfo("Parse configure: " + data);
|
||||||
|
|
||||||
JSONVar root = JSON.parse(data);
|
JSONVar root = JSON.parse(data);
|
||||||
failedMessage = "";
|
failedMessage = "";
|
||||||
if (JSON.typeof_(root) == "undefined") {
|
if (JSON.typeof_(root) == "undefined") {
|
||||||
@ -477,6 +479,7 @@ bool Configuration::parse(String data, bool isLocal) {
|
|||||||
logInfo("set temperatureUnit: " + String(temperatureUnit));
|
logInfo("set temperatureUnit: " + String(temperatureUnit));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isLocal) {
|
||||||
if (JSON.typeof_(root["postDataToAirGradient"]) == "boolean") {
|
if (JSON.typeof_(root["postDataToAirGradient"]) == "boolean") {
|
||||||
bool post = root["postDataToAirGradient"];
|
bool post = root["postDataToAirGradient"];
|
||||||
if (post != config.postDataToAirGradient) {
|
if (post != config.postDataToAirGradient) {
|
||||||
@ -492,6 +495,7 @@ bool Configuration::parse(String data, bool isLocal) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** Parse data only got from AirGradient server */
|
/** Parse data only got from AirGradient server */
|
||||||
if (isLocal == false) {
|
if (isLocal == false) {
|
||||||
@ -520,6 +524,10 @@ bool Configuration::parse(String data, bool isLocal) {
|
|||||||
if (changed) {
|
if (changed) {
|
||||||
udpated = true;
|
udpated = true;
|
||||||
saveConfig();
|
saveConfig();
|
||||||
|
} else {
|
||||||
|
if (ledBarTestRequested || co2CalibrationRequested) {
|
||||||
|
udpated = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
printConfig();
|
printConfig();
|
||||||
return true;
|
return true;
|
||||||
|
Reference in New Issue
Block a user