-
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
[Fix] PM2.5 compensated show on display #224
Conversation
src/AgOledDisplay.cpp
Outdated
} | ||
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 comment
The 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 comment
The reason will be displayed to describe this comment to others. Learn more.
it's the API on utils
can not use isValid
cause there are multiple API check sensor valid like CO2
, Temperature
, etc.
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.
OK, then I propose to write
isValidPm()
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.
@nick-4711
Updated 753f229
src/AgOledDisplay.cpp
Outdated
@@ -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); |
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()
Update missing add PM2.5 compensated before show on display. #221