Fixed bug with N/A value display in PM2.5 sensor display.

This commit is contained in:
Marcus Scholz 2021-10-09 04:42:36 +02:00
parent 7db5ff465a
commit 6d59b62497

View File

@ -415,10 +415,9 @@ display:
if(livingroom_pm25 < 255 && livingroom_pm25 >=0) {
it.printf(200, 114 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "%3d", livingroom_pm25);
it.print(205, 114 + offsetY, id(big_sensor_unit), TextAlign::BASELINE_LEFT, "µg/m³");
}
if(livingroom_pm25 >= pm25_danger_thres) {
it.print(37, 114 + offsetY, id(mdi_med), TextAlign::BASELINE_CENTER, "󰀦"); // warning
if(livingroom_pm25 >= pm25_danger_thres) {
it.print(37, 114 + offsetY, id(mdi_med), TextAlign::BASELINE_CENTER, "󰀦"); // warning
}
}
else {
it.print(200, 114 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "- ");
@ -461,10 +460,9 @@ display:
if(sleepingroom_pm25 < 255 && sleepingroom_pm25 >=0) {
it.printf(200, 114 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "%3d", sleepingroom_pm25);
it.print(205, 114 + offsetY, id(big_sensor_unit), TextAlign::BASELINE_LEFT, "µg/m³");
}
if(sleepingroom_pm25 >= pm25_danger_thres) {
it.print(37, 114 + offsetY, id(mdi_med), TextAlign::BASELINE_CENTER, "󰀦"); // warning
if(sleepingroom_pm25 >= pm25_danger_thres) {
it.print(37, 114 + offsetY, id(mdi_med), TextAlign::BASELINE_CENTER, "󰀦"); // warning
}
}
else {
it.print(200, 114 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "- ");