Use camel case for transmission payload

This commit is contained in:
samuelbles07
2024-10-23 11:05:16 +07:00
parent 4783684443
commit 85e779cfc2
2 changed files with 28 additions and 28 deletions
+24 -24
View File
@@ -591,13 +591,13 @@ JSONVar Measurements::buildPMS(AirGradient &ag, int ch, bool allCh, bool withTem
pms["pm10"] = ag.round2(_pm_10[ch].update.avg);
}
if (utils::isValidPm(_pm_01_sp[ch].update.avg)) {
pms["pm01_sp"] = ag.round2(_pm_01_sp[ch].update.avg);
pms["pm01Standard"] = ag.round2(_pm_01_sp[ch].update.avg);
}
if (utils::isValidPm(_pm_25_sp[ch].update.avg)) {
pms["pm02_sp"] = ag.round2(_pm_25_sp[ch].update.avg);
pms["pm02Standard"] = ag.round2(_pm_25_sp[ch].update.avg);
}
if (utils::isValidPm(_pm_10_sp[ch].update.avg)) {
pms["pm10_sp"] = ag.round2(_pm_10_sp[ch].update.avg);
pms["pm10Standard"] = ag.round2(_pm_10_sp[ch].update.avg);
}
if (utils::isValidPm03Count(_pm_03_pc[ch].update.avg)) {
pms["pm003Count"] = ag.round2(_pm_03_pc[ch].update.avg);
@@ -706,43 +706,43 @@ JSONVar Measurements::buildPMS(AirGradient &ag, int ch, bool allCh, bool withTem
/// PM1.0 standard particle
if (utils::isValidPm(_pm_01_sp[0].update.avg) && utils::isValidPm(_pm_01_sp[1].update.avg)) {
float avg = (_pm_01_sp[0].update.avg + _pm_01_sp[1].update.avg) / 2.0f;
pms["pm01_sp"] = ag.round2(avg);
pms["channels"]["1"]["pm01_sp"] = ag.round2(_pm_01_sp[0].update.avg);
pms["channels"]["2"]["pm01_sp"] = ag.round2(_pm_01_sp[1].update.avg);
pms["pm01Standard"] = ag.round2(avg);
pms["channels"]["1"]["pm01Standard"] = ag.round2(_pm_01_sp[0].update.avg);
pms["channels"]["2"]["pm01Standard"] = ag.round2(_pm_01_sp[1].update.avg);
} else if (utils::isValidPm(_pm_01_sp[0].update.avg)) {
pms["pm01_sp"] = ag.round2(_pm_01_sp[0].update.avg);
pms["channels"]["1"]["pm01_sp"] = ag.round2(_pm_01_sp[0].update.avg);
pms["pm01Standard"] = ag.round2(_pm_01_sp[0].update.avg);
pms["channels"]["1"]["pm01Standard"] = ag.round2(_pm_01_sp[0].update.avg);
} else if (utils::isValidPm(_pm_01_sp[1].update.avg)) {
pms["pm01_sp"] = ag.round2(_pm_01_sp[1].update.avg);
pms["channels"]["2"]["pm01_sp"] = ag.round2(_pm_01_sp[1].update.avg);
pms["pm01Standard"] = ag.round2(_pm_01_sp[1].update.avg);
pms["channels"]["2"]["pm01Standard"] = ag.round2(_pm_01_sp[1].update.avg);
}
/// PM2.5 standard particle
if (utils::isValidPm(_pm_25_sp[0].update.avg) && utils::isValidPm(_pm_25_sp[1].update.avg)) {
float avg = (_pm_25_sp[0].update.avg + _pm_25_sp[1].update.avg) / 2.0f;
pms["pm02_sp"] = ag.round2(avg);
pms["channels"]["1"]["pm02_sp"] = ag.round2(_pm_25_sp[0].update.avg);
pms["channels"]["2"]["pm02_sp"] = ag.round2(_pm_25_sp[1].update.avg);
pms["pm02Standard"] = ag.round2(avg);
pms["channels"]["1"]["pm02Standard"] = ag.round2(_pm_25_sp[0].update.avg);
pms["channels"]["2"]["pm02Standard"] = ag.round2(_pm_25_sp[1].update.avg);
} else if (utils::isValidPm(_pm_25_sp[0].update.avg)) {
pms["pm02_sp"] = ag.round2(_pm_25_sp[0].update.avg);
pms["channels"]["1"]["pm02_sp"] = ag.round2(_pm_25_sp[0].update.avg);
pms["pm02Standard"] = ag.round2(_pm_25_sp[0].update.avg);
pms["channels"]["1"]["pm02Standard"] = ag.round2(_pm_25_sp[0].update.avg);
} else if (utils::isValidPm(_pm_25_sp[1].update.avg)) {
pms["pm02_sp"] = ag.round2(_pm_25_sp[1].update.avg);
pms["channels"]["2"]["pm02_sp"] = ag.round2(_pm_25_sp[1].update.avg);
pms["pm02Standard"] = ag.round2(_pm_25_sp[1].update.avg);
pms["channels"]["2"]["pm02Standard"] = ag.round2(_pm_25_sp[1].update.avg);
}
/// PM10 standard particle
if (utils::isValidPm(_pm_10_sp[0].update.avg) && utils::isValidPm(_pm_10_sp[1].update.avg)) {
float avg = (_pm_10_sp[0].update.avg + _pm_10_sp[1].update.avg) / 2.0f;
pms["pm10_sp"] = ag.round2(avg);
pms["channels"]["1"]["pm10_sp"] = ag.round2(_pm_10_sp[0].update.avg);
pms["channels"]["2"]["pm10_sp"] = ag.round2(_pm_10_sp[1].update.avg);
pms["pm10Standard"] = ag.round2(avg);
pms["channels"]["1"]["pm10Standard"] = ag.round2(_pm_10_sp[0].update.avg);
pms["channels"]["2"]["pm10Standard"] = ag.round2(_pm_10_sp[1].update.avg);
} else if (utils::isValidPm(_pm_10_sp[0].update.avg)) {
pms["pm10_sp"] = ag.round2(_pm_10_sp[0].update.avg);
pms["channels"]["1"]["pm10_sp"] = ag.round2(_pm_10_sp[0].update.avg);
pms["pm10Standard"] = ag.round2(_pm_10_sp[0].update.avg);
pms["channels"]["1"]["pm10Standard"] = ag.round2(_pm_10_sp[0].update.avg);
} else if (utils::isValidPm(_pm_10_sp[1].update.avg)) {
pms["pm10_sp"] = ag.round2(_pm_10_sp[1].update.avg);
pms["channels"]["2"]["pm10_sp"] = ag.round2(_pm_10_sp[1].update.avg);
pms["pm10Standard"] = ag.round2(_pm_10_sp[1].update.avg);
pms["channels"]["2"]["pm10Standard"] = ag.round2(_pm_10_sp[1].update.avg);
}
/// PM003 particle count