mirror of
https://github.com/airgradienthq/arduino.git
synced 2025-07-04 11:46:32 +02:00
update handle noxLearningOffset
and tvocLearningOffset
configuration
This commit is contained in:
@ -403,6 +403,7 @@ bool Configuration::parse(String data, bool isLocal) {
|
||||
int tvocLearningOffset = root["tvocLearningOffset"];
|
||||
if (tvocLearningOffset != config.tvocLearningOffset) {
|
||||
changed = true;
|
||||
_tvocLearningOffsetChanged = true;
|
||||
config.tvocLearningOffset = tvocLearningOffset;
|
||||
logInfo("Set tvocLearningOffset: " + String(tvocLearningOffset));
|
||||
}
|
||||
@ -418,6 +419,7 @@ bool Configuration::parse(String data, bool isLocal) {
|
||||
int noxLearningOffset = root["noxLearningOffset"];
|
||||
if (noxLearningOffset != config.noxLearningOffset) {
|
||||
changed = true;
|
||||
_noxLearnOffsetChanged = true;
|
||||
config.noxLearningOffset = noxLearningOffset;
|
||||
logInfo("Set noxLearningOffset: " + String(noxLearningOffset));
|
||||
}
|
||||
@ -518,11 +520,10 @@ bool Configuration::parse(String data, bool isLocal) {
|
||||
}
|
||||
|
||||
if (changed) {
|
||||
udpated = true;
|
||||
saveConfig();
|
||||
}
|
||||
printConfig();
|
||||
|
||||
udpated = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -740,3 +741,23 @@ void Configuration::setPostToAirGradient(bool enable) {
|
||||
logInfo("postDataToAirGradient: Ignored set to " + String(enable));
|
||||
}
|
||||
}
|
||||
|
||||
bool Configuration::noxLearnOffsetChanged(void) {
|
||||
bool changed = _noxLearnOffsetChanged;
|
||||
_noxLearnOffsetChanged = false;
|
||||
return changed;
|
||||
}
|
||||
|
||||
bool Configuration::tvocLearnOffsetChanged(void) {
|
||||
bool changed = _tvocLearningOffsetChanged;
|
||||
_tvocLearningOffsetChanged = false;
|
||||
return changed;
|
||||
}
|
||||
|
||||
int Configuration::getTvocLearningOffset(void) {
|
||||
return config.tvocLearningOffset;
|
||||
}
|
||||
|
||||
int Configuration::getNoxLearningOffset(void) {
|
||||
return config.noxLearningOffset;
|
||||
}
|
||||
|
Reference in New Issue
Block a user