Skip to content
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

Merged
merged 5 commits into from
Sep 2, 2024

Conversation

pnt325
Copy link
Collaborator

@pnt325 pnt325 commented Aug 25, 2024

Update missing add PM2.5 compensated before show on display. #221

}
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)) {
Copy link
Collaborator

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()

Copy link
Collaborator Author

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.

Copy link
Collaborator

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()

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -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);
Copy link
Collaborator

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()

@pnt325 pnt325 requested a review from nick-4711 August 26, 2024 13:20
@airgradienthq airgradienthq merged commit 6f1cef4 into develop Sep 2, 2024
20 checks passed
@pnt325 pnt325 deleted the hotfix/pms25-compensated-show-on-display branch September 2, 2024 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants