From d5cdeaa9f33f7cecbdf45d790a99afd9d700ead2 Mon Sep 17 00:00:00 2001 From: samuelbles07 Date: Wed, 14 May 2025 13:01:23 +0700 Subject: [PATCH] Fix print average function schedule if pms value invalid show the channel --- src/AgValue.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/AgValue.cpp b/src/AgValue.cpp index ca841d0..ef4d01d 100644 --- a/src/AgValue.cpp +++ b/src/AgValue.cpp @@ -656,59 +656,59 @@ void Measurements::printCurrentPMAverage(int ch) { if (utils::isValidPm(_pm_01[idx].update.avg)) { Serial.printf("[%d] Atmospheric PM 1.0 = %.2f ug/m3\n", ch, _pm_01[idx].update.avg); } else { - Serial.printf("[%d] Atmospheric PM 1.0 = -\n"); + Serial.printf("[%d] Atmospheric PM 1.0 = -\n", ch); } if (utils::isValidPm(_pm_25[idx].update.avg)) { Serial.printf("[%d] Atmospheric PM 2.5 = %.2f ug/m3\n", ch, _pm_25[idx].update.avg); } else { - Serial.printf("[%d] Atmospheric PM 2.5 = -\n"); + Serial.printf("[%d] Atmospheric PM 2.5 = -\n", ch); } if (utils::isValidPm(_pm_10[idx].update.avg)) { Serial.printf("[%d] Atmospheric PM 10 = %.2f ug/m3\n", ch, _pm_10[idx].update.avg); } else { - Serial.printf("[%d] Atmospheric PM 10 = -\n"); + Serial.printf("[%d] Atmospheric PM 10 = -\n", ch); } if (utils::isValidPm(_pm_01_sp[idx].update.avg)) { Serial.printf("[%d] Standard Particle PM 1.0 = %.2f ug/m3\n", ch, _pm_01_sp[idx].update.avg); } else { - Serial.printf("[%d] Standard Particle PM 1.0 = -\n"); + Serial.printf("[%d] Standard Particle PM 1.0 = -\n", ch); } if (utils::isValidPm(_pm_25_sp[idx].update.avg)) { Serial.printf("[%d] Standard Particle PM 2.5 = %.2f ug/m3\n", ch, _pm_25_sp[idx].update.avg); } else { - Serial.printf("[%d] Standard Particle PM 2.5 = -\n"); + Serial.printf("[%d] Standard Particle PM 2.5 = -\n", ch); } if (utils::isValidPm(_pm_10_sp[idx].update.avg)) { Serial.printf("[%d] Standard Particle PM 10 = %.2f ug/m3\n", ch, _pm_10_sp[idx].update.avg); } else { - Serial.printf("[%d] Standard Particle PM 10 = -\n"); + Serial.printf("[%d] Standard Particle PM 10 = -\n", ch); } if (utils::isValidPm03Count(_pm_03_pc[idx].update.avg)) { Serial.printf("[%d] Particle Count 0.3 = %.1f\n", ch, _pm_03_pc[idx].update.avg); } else { - Serial.printf("[%d] Particle Count 0.3 = -\n"); + Serial.printf("[%d] Particle Count 0.3 = -\n", ch); } if (utils::isValidPm03Count(_pm_05_pc[idx].update.avg)) { Serial.printf("[%d] Particle Count 0.5 = %.1f\n", ch, _pm_05_pc[idx].update.avg); } else { - Serial.printf("[%d] Particle Count 0.5 = -\n"); + Serial.printf("[%d] Particle Count 0.5 = -\n", ch); } if (utils::isValidPm03Count(_pm_01_pc[idx].update.avg)) { Serial.printf("[%d] Particle Count 1.0 = %.1f\n", ch, _pm_01_pc[idx].update.avg); } else { - Serial.printf("[%d] Particle Count 1.0 = -\n"); + Serial.printf("[%d] Particle Count 1.0 = -\n", ch); } if (utils::isValidPm03Count(_pm_25_pc[idx].update.avg)) { Serial.printf("[%d] Particle Count 2.5 = %.1f\n", ch, _pm_25_pc[idx].update.avg); } else { - Serial.printf("[%d] Particle Count 2.5 = -\n"); + Serial.printf("[%d] Particle Count 2.5 = -\n", ch); } if (_pm_5_pc[idx].listValues.empty() == false) { if (utils::isValidPm03Count(_pm_5_pc[idx].update.avg)) { Serial.printf("[%d] Particle Count 5.0 = %.1f\n", ch, _pm_5_pc[idx].update.avg); } else { - Serial.printf("[%d] Particle Count 5.0 = -\n"); + Serial.printf("[%d] Particle Count 5.0 = -\n", ch); } } @@ -716,7 +716,7 @@ void Measurements::printCurrentPMAverage(int ch) { if (utils::isValidPm03Count(_pm_10_pc[idx].update.avg)) { Serial.printf("[%d] Particle Count 10 = %.1f\n", ch, _pm_10_pc[idx].update.avg); } else { - Serial.printf("[%d] Particle Count 10 = -\n"); + Serial.printf("[%d] Particle Count 10 = -\n", ch); } } }