mirror of
https://github.com/airgradienthq/arduino.git
synced 2025-07-30 17:07:16 +02:00
Fix use the right function
This commit is contained in:
@ -896,10 +896,10 @@ JSONVar Measurements::buildPMS(AirGradient &ag, int ch, bool allCh, bool withTem
|
||||
pms[json_prop_pm03Count] = ag.round2(avg);
|
||||
pms["channels"]["1"][json_prop_pm03Count] = ag.round2(_pm_03_pc[0].update.avg);
|
||||
pms["channels"]["2"][json_prop_pm03Count] = ag.round2(_pm_03_pc[1].update.avg);
|
||||
} else if (utils::isValidPm(_pm_03_pc[0].update.avg)) {
|
||||
} else if (utils::isValidPm03Count(_pm_03_pc[0].update.avg)) {
|
||||
pms[json_prop_pm03Count] = ag.round2(_pm_03_pc[0].update.avg);
|
||||
pms["channels"]["1"][json_prop_pm03Count] = ag.round2(_pm_03_pc[0].update.avg);
|
||||
} else if (utils::isValidPm(_pm_03_pc[1].update.avg)) {
|
||||
} else if (utils::isValidPm03Count(_pm_03_pc[1].update.avg)) {
|
||||
pms[json_prop_pm03Count] = ag.round2(_pm_03_pc[1].update.avg);
|
||||
pms["channels"]["2"][json_prop_pm03Count] = ag.round2(_pm_03_pc[1].update.avg);
|
||||
}
|
||||
@ -911,10 +911,10 @@ JSONVar Measurements::buildPMS(AirGradient &ag, int ch, bool allCh, bool withTem
|
||||
pms[json_prop_pm05Count] = ag.round2(avg);
|
||||
pms["channels"]["1"][json_prop_pm05Count] = ag.round2(_pm_05_pc[0].update.avg);
|
||||
pms["channels"]["2"][json_prop_pm05Count] = ag.round2(_pm_05_pc[1].update.avg);
|
||||
} else if (utils::isValidPm(_pm_05_pc[0].update.avg)) {
|
||||
} else if (utils::isValidPm03Count(_pm_05_pc[0].update.avg)) {
|
||||
pms[json_prop_pm05Count] = ag.round2(_pm_05_pc[0].update.avg);
|
||||
pms["channels"]["1"][json_prop_pm05Count] = ag.round2(_pm_05_pc[0].update.avg);
|
||||
} else if (utils::isValidPm(_pm_05_pc[1].update.avg)) {
|
||||
} else if (utils::isValidPm03Count(_pm_05_pc[1].update.avg)) {
|
||||
pms[json_prop_pm05Count] = ag.round2(_pm_05_pc[1].update.avg);
|
||||
pms["channels"]["2"][json_prop_pm05Count] = ag.round2(_pm_05_pc[1].update.avg);
|
||||
}
|
||||
@ -925,10 +925,10 @@ JSONVar Measurements::buildPMS(AirGradient &ag, int ch, bool allCh, bool withTem
|
||||
pms[json_prop_pm1Count] = ag.round2(avg);
|
||||
pms["channels"]["1"][json_prop_pm1Count] = ag.round2(_pm_01_pc[0].update.avg);
|
||||
pms["channels"]["2"][json_prop_pm1Count] = ag.round2(_pm_01_pc[1].update.avg);
|
||||
} else if (utils::isValidPm(_pm_01_pc[0].update.avg)) {
|
||||
} else if (utils::isValidPm03Count(_pm_01_pc[0].update.avg)) {
|
||||
pms[json_prop_pm1Count] = ag.round2(_pm_01_pc[0].update.avg);
|
||||
pms["channels"]["1"][json_prop_pm1Count] = ag.round2(_pm_01_pc[0].update.avg);
|
||||
} else if (utils::isValidPm(_pm_01_pc[1].update.avg)) {
|
||||
} else if (utils::isValidPm03Count(_pm_01_pc[1].update.avg)) {
|
||||
pms[json_prop_pm1Count] = ag.round2(_pm_01_pc[1].update.avg);
|
||||
pms["channels"]["2"][json_prop_pm1Count] = ag.round2(_pm_01_pc[1].update.avg);
|
||||
}
|
||||
@ -940,10 +940,10 @@ JSONVar Measurements::buildPMS(AirGradient &ag, int ch, bool allCh, bool withTem
|
||||
pms[json_prop_pm25Count] = ag.round2(avg);
|
||||
pms["channels"]["1"][json_prop_pm25Count] = ag.round2(_pm_25_pc[0].update.avg);
|
||||
pms["channels"]["2"][json_prop_pm25Count] = ag.round2(_pm_25_pc[1].update.avg);
|
||||
} else if (utils::isValidPm(_pm_25_pc[0].update.avg)) {
|
||||
} else if (utils::isValidPm03Count(_pm_25_pc[0].update.avg)) {
|
||||
pms[json_prop_pm25Count] = ag.round2(_pm_25_pc[0].update.avg);
|
||||
pms["channels"]["1"][json_prop_pm25Count] = ag.round2(_pm_25_pc[0].update.avg);
|
||||
} else if (utils::isValidPm(_pm_25_pc[1].update.avg)) {
|
||||
} else if (utils::isValidPm03Count(_pm_25_pc[1].update.avg)) {
|
||||
pms[json_prop_pm25Count] = ag.round2(_pm_25_pc[1].update.avg);
|
||||
pms["channels"]["2"][json_prop_pm25Count] = ag.round2(_pm_25_pc[1].update.avg);
|
||||
}
|
||||
|
Reference in New Issue
Block a user