Skip to content

Commit

Permalink
update CO2CalibrationAbcDays
Browse files Browse the repository at this point in the history
  • Loading branch information
pnt325 committed Apr 21, 2024
1 parent 556a6fb commit 8980255
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions src/AgConfigure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ void Configuration::defaultConfig(void) {
config.postDataToAirGradient = true;
config.displayMode = true;
config.useRGBLedBar = LedBarMode::LedBarModeCO2;
config.abcDays = 7;
config.abcDays = 8;
config.tvocLearningOffset = 12;
config.noxLearningOffset = 12;
config.temperatureUnit = 'c';
Expand Down Expand Up @@ -382,9 +382,7 @@ bool Configuration::parse(String data, bool isLocal) {
if (JSON.typeof_(root["abcDays"]) == "number") {
int abcDays = root["abcDays"];
if (abcDays <= 0) {
failedMessage = jsonTypeInvalidMessage("abcDaysabcDays", String(abcDays));
jsonInvalid();
return false;
abcDays = 0;
}
if (abcDays != config.abcDays) {
config.abcDays = abcDays;
Expand Down
2 changes: 1 addition & 1 deletion src/AgStateMachine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ void StateMachine::co2Calibration(void) {
}
}

if (config.getCO2CalibrationAbcDays() > 0 && config.hasSensorS8) {
if (config.getCO2CalibrationAbcDays() >= 0 && config.hasSensorS8) {
int newHour = config.getCO2CalibrationAbcDays() * 24;
logInfo("Requested abcDays setting: " +
String(config.getCO2CalibrationAbcDays()) + "days (" +
Expand Down

0 comments on commit 8980255

Please sign in to comment.