fix: adopt 2024 EPA PM2.5 AQI breakpoints for cross-platform alignment#6273
Merged
Conversation
Android's PM2.5→AQI conversion (#6102) used the legacy (pre-2024) EPA breakpoint table. iOS is landing a computed NowCast AQI (meshtastic/Meshtastic-Apple#2075) on the current 2024 EPA PM2.5 24-hour table, so the same reading produced a different AQI per platform — the exact divergence meshtastic/design#54 exists to prevent. Swap the breakpoint constants to the 2024 EPA table (AQS parameter 88101). NowCast weighting (12h rolling window, 0.5 min weight factor) and the Equation-1 interpolation are unchanged. Landing this before the iOS feature ships keeps the two curves aligned. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe PM2.5 AQI breakpoint table now uses 2024 EPA concentration ranges. Existing breakpoint tests were updated, and a regression test verifies that 10.0 µg/m³ maps to AQI 53. ChangesPM2.5 AQI breakpoint update
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related issues
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
jamesarich
marked this pull request as ready for review
July 15, 2026 12:04
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Part of the cross-platform AQI alignment work (meshtastic/design#54). iOS is landing a computed EPA NowCast AQI (meshtastic/Meshtastic-Apple#2075) built on the current (2024) EPA PM2.5 24-hour breakpoint table. Android's already-merged implementation (#6102) used the legacy (pre-2024) table, so the same PM2.5 reading produced a different AQI per platform — exactly the divergence design#54 exists to prevent.
This lands the 2024 table on Android before the iOS feature ships, so the two never present diverging curves.
Fixes #6272.
🐛 Changes
Swapped the PM2.5 breakpoint constants in
core/model/.../util/AirQualityIndex.ktfrom the legacy table to the current 2024 EPA table (AQS parameter 88101):Constants only. The NowCast weighting (12h rolling window, 0.5 min weight factor) and the Equation-1 linear interpolation are untouched.
🛠️ Testing Performed
Updated
AirQualityIndexTestbreakpoint vectors to the 2024 table and re-derived the affected expected AQI values:9.0→50,9.1→51,35.4→100,35.5→101,55.4→150,55.5→151,125.4→200,125.5→201,225.4→300,225.5→301,325.4→500.42 ("Good")on the legacy table (matches the worked example in Update PM2.5 AQI breakpoints to current (2024) EPA table for cross-platform alignment #6272 and the iOS reference).Verified locally:
./gradlew :core:model:allTests(all 11 AirQualityIndex tests pass), plusspotlessApply spotlessCheck detektall clean.Summary by CodeRabbit
Bug Fixes
Tests