-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Fix] PM2.5 compensated show on display #224
Changes from 1 commit
63f653d
7a988ea
c459017
753f229
2e9ff0d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -307,20 +307,21 @@ void OledDisplay::showDashboard(const char *status) { | |
int pm25 = value.pm25_1; | ||
if (config.hasSensorSHT) { | ||
pm25 = ag->pms5003.compensated(pm25, value.Humidity); | ||
logInfo("PM2.5:" + String(value.pm25_1) + String("Compensated:") + String(pm25)); | ||
} | ||
DISP()->setFont(u8g2_font_t0_22b_tf); | ||
if (config.isPmStandardInUSAQI()) { | ||
if (utils::isValidPMS(value.pm25_1)) { | ||
sprintf(strBuf, "%d", ag->pms5003.convertPm25ToUsAqi(value.pm25_1)); | ||
if (utils::isValidPMS(pm25)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the method name isValidPMS is misleading, propose to rename to simply isValid() There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it's the API on There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, then I propose to write isValidPm() There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @nick-4711 |
||
sprintf(strBuf, "%d", ag->pms5003.convertPm25ToUsAqi(pm25)); | ||
} else { | ||
sprintf(strBuf, "%s", "-"); | ||
} | ||
DISP()->drawStr(55, 48, strBuf); | ||
DISP()->setFont(u8g2_font_t0_12_tf); | ||
DISP()->drawUTF8(55, 61, "AQI"); | ||
} else { | ||
if (utils::isValidPMS(value.pm25_1)) { | ||
sprintf(strBuf, "%d", value.pm25_1); | ||
if (utils::isValidPMS(pm25)) { | ||
sprintf(strBuf, "%d", pm25); | ||
} else { | ||
sprintf(strBuf, "%s", "-"); | ||
} | ||
|
@@ -369,8 +370,8 @@ void OledDisplay::showDashboard(const char *status) { | |
pm25 = (int)ag->pms5003.compensated(pm25, value.Humidity); | ||
} | ||
ag->display.setCursor(0, 12); | ||
if (utils::isValidPMS(value.pm25_1)) { | ||
snprintf(strBuf, sizeof(strBuf), "PM2.5:%d", value.pm25_1); | ||
if (utils::isValidPMS(pm25)) { | ||
snprintf(strBuf, sizeof(strBuf), "PM2.5:%d", pm25); | ||
} else { | ||
snprintf(strBuf, sizeof(strBuf), "PM2.5:-"); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the method name should be renamed to compensate()