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

View File

@ -54,14 +54,14 @@ You get the following response:
| `pm02` | Number | PM2.5 in ug/m3 (atmospheric environment) |
| `pm10` | Number | PM10 in ug/m3 (atmospheric environment) |
| `pm02Compensated` | Number | PM2.5 in ug/m3 with correction applied (from fw version 3.1.4 onwards) |
| `pm01_sp` | Number | PM1.0 in ug/m3 (standard particle) |
| `pm02_sp` | Number | PM2.5 in ug/m3 (standard particle) |
| `pm10_sp` | Number | PM10 in ug/m3 (standard particle) |
| `pm01Standard` | Number | PM1.0 in ug/m3 (standard particle) |
| `pm02Standard` | Number | PM2.5 in ug/m3 (standard particle) |
| `pm10Standard` | Number | PM10 in ug/m3 (standard particle) |
| `rco2` | Number | CO2 in ppm |
| `pm003Count` | Number | Particle count 0.3um per dL |
| `pm01Count` | Number | Particle count 1.0um per dL |
| `pm25Count` | Number | Particle count 2.5um per dL |
| `pm10Count` | Number | Particle count 10um per dL |
| `pm10Count` | Number | Particle count 10um per dL (only for indoor monitor) |
| `atmp` | Number | Temperature in Degrees Celsius |
| `atmpCompensated` | Number | Temperature in Degrees Celsius with correction applied |
| `rhum` | Number | Relative Humidity |

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