mirror of
https://github.com/airgradienthq/arduino.git
synced 2025-07-14 08:26:31 +02:00
add firmware mode O-1P
This commit is contained in:
@ -105,37 +105,70 @@ String Measurements::toString(bool localServer, AgFirmwareMode fwMode, int rssi,
|
||||
(int)ag->pms5003t_2.humidityCompensated(this->hum_2);
|
||||
}
|
||||
} else {
|
||||
if (config->hasSensorPMS1) {
|
||||
root["channels"]["1"]["pm01"] = this->pm01_1;
|
||||
root["channels"]["1"]["pm02"] = this->pm25_1;
|
||||
root["channels"]["1"]["pm10"] = this->pm10_1;
|
||||
if (localServer) {
|
||||
root["channels"]["1"]["pm003Count"] = this->pm03PCount_1;
|
||||
} else {
|
||||
root["channels"]["1"]["pm003_count"] = this->pm03PCount_1;
|
||||
if (fwMode == FW_MODE_O_1P) {
|
||||
if (config->hasSensorPMS1) {
|
||||
root["pm01"] = this->pm01_1;
|
||||
root["pm02"] = this->pm25_1;
|
||||
root["pm10"] = this->pm10_1;
|
||||
if (localServer) {
|
||||
root["pm003Count"] = this->pm03PCount_1;
|
||||
} else {
|
||||
root["pm003_count"] = this->pm03PCount_1;
|
||||
}
|
||||
root["atmp"] = ag->round2(this->temp_1);
|
||||
root["rhum"] = this->hum_1;
|
||||
root["atmp_compensated"] =
|
||||
ag->round2(ag->pms5003t_1.temperatureCompensated(this->temp_1));
|
||||
root["rhum_compensated"] =
|
||||
(int)ag->pms5003t_1.humidityCompensated(this->hum_1);
|
||||
} else if (config->hasSensorPMS2) {
|
||||
root["pm01"] = this->pm01_2;
|
||||
root["pm02"] = this->pm25_2;
|
||||
root["pm10"] = this->pm10_2;
|
||||
if (localServer) {
|
||||
root["pm003Count"] = this->pm03PCount_2;
|
||||
} else {
|
||||
root["pm003_count"] = this->pm03PCount_2;
|
||||
}
|
||||
root["atmp"] = ag->round2(this->temp_2);
|
||||
root["rhum"] = this->hum_2;
|
||||
root["atmp_compensated"] =
|
||||
ag->round2(ag->pms5003t_1.temperatureCompensated(this->temp_2));
|
||||
root["rhum_compensated"] =
|
||||
(int)ag->pms5003t_1.humidityCompensated(this->hum_2);
|
||||
}
|
||||
root["channels"]["1"]["atmp"] = ag->round2(this->temp_1);
|
||||
root["channels"]["1"]["rhum"] = this->hum_1;
|
||||
root["channels"]["1"]["atmp_compensated"] =
|
||||
ag->round2(ag->pms5003t_1.temperatureCompensated(this->temp_1));
|
||||
root["channels"]["1"]["rhum_compensated"] =
|
||||
(int)ag->pms5003t_1.humidityCompensated(this->hum_1);
|
||||
}
|
||||
if (config->hasSensorPMS2) {
|
||||
root["channels"]["2"]["pm01"] = this->pm01_2;
|
||||
root["channels"]["2"]["pm02"] = this->pm25_2;
|
||||
root["channels"]["2"]["pm10"] = this->pm10_2;
|
||||
if (localServer) {
|
||||
root["channels"]["2"]["pm003Count"] = this->pm03PCount_2;
|
||||
} else {
|
||||
root["channels"]["2"]["pm003_count"] = this->pm03PCount_2;
|
||||
} else {
|
||||
if (config->hasSensorPMS1) {
|
||||
root["channels"]["1"]["pm01"] = this->pm01_1;
|
||||
root["channels"]["1"]["pm02"] = this->pm25_1;
|
||||
root["channels"]["1"]["pm10"] = this->pm10_1;
|
||||
if (localServer) {
|
||||
root["channels"]["1"]["pm003Count"] = this->pm03PCount_1;
|
||||
} else {
|
||||
root["channels"]["1"]["pm003_count"] = this->pm03PCount_1;
|
||||
}
|
||||
root["channels"]["1"]["atmp"] = ag->round2(this->temp_1);
|
||||
root["channels"]["1"]["rhum"] = this->hum_1;
|
||||
root["channels"]["1"]["atmp_compensated"] =
|
||||
ag->round2(ag->pms5003t_1.temperatureCompensated(this->temp_1));
|
||||
root["channels"]["1"]["rhum_compensated"] =
|
||||
(int)ag->pms5003t_1.humidityCompensated(this->hum_1);
|
||||
} else if (config->hasSensorPMS2) {
|
||||
root["channels"]["2"]["pm01"] = this->pm01_2;
|
||||
root["channels"]["2"]["pm02"] = this->pm25_2;
|
||||
root["channels"]["2"]["pm10"] = this->pm10_2;
|
||||
if (localServer) {
|
||||
root["channels"]["2"]["pm003Count"] = this->pm03PCount_2;
|
||||
} else {
|
||||
root["channels"]["2"]["pm003_count"] = this->pm03PCount_2;
|
||||
}
|
||||
root["channels"]["2"]["atmp"] = ag->round2(this->temp_2);
|
||||
root["channels"]["2"]["rhum"] = this->hum_2;
|
||||
root["channels"]["2"]["atmp_compensated"] =
|
||||
ag->round2(ag->pms5003t_1.temperatureCompensated(this->temp_2));
|
||||
root["channels"]["2"]["rhum_compensated"] =
|
||||
(int)ag->pms5003t_1.humidityCompensated(this->hum_2);
|
||||
}
|
||||
root["channels"]["2"]["atmp"] = ag->round2(this->temp_2);
|
||||
root["channels"]["2"]["rhum"] = this->hum_2;
|
||||
root["channels"]["2"]["atmp_compensated"] =
|
||||
ag->round2(ag->pms5003t_1.temperatureCompensated(this->temp_2));
|
||||
root["channels"]["2"]["rhum_compensated"] =
|
||||
(int)ag->pms5003t_1.humidityCompensated(this->hum_2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user