feat: add air quality telemetry display (PM1.0, PM2.5, PM10, CO2)#5701
Merged
Conversation
- Add defaultValue to air_quality_metrics BLOB column for Room auto-migration - Replace non-null assertion with safe let in TelemetryPacketHandlerImpl - Remove unused range property from Co2Severity enum Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Fix stringResource called in non-composable context (pre-resolve labels) - Fix DateFormatter.formatShort → DateFormatter.formatDateTime - Rename onPointSelected → onSelectPoint (detekt ParameterNaming) - Reorder modifier param to end (detekt ComposableParamOrder) - Add @Suppress for CyclomaticComplexMethod on CSV export Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
🖼️ Preview staleness check — advisoryThis PR modifies UI composables but does not update any
Changed UI files: What to check:
Adding previews checklist:
If this PR does not require preview updates (e.g., logic-only change, non-visual refactor), add the |
Draft
Resolved conflicts: - NodeEntity.toModel(): release's direct-construction form + airQualityMetrics line - Room schema renumbered v39 -> v40 (FTS5 owns v39): version=40, AutoMigration(39->40), regenerated 40.json, kept FTS5's 39.json - proto pinned to 6b1ded4 (master HEAD) - docs (copilot-instructions, .specify/feature.json): take release/2.8.0
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.
Air Quality Telemetry Display
The
AirQualityMetricsproto has existed in the firmware for some time, but the Android app never stored or displayed it. This PR adds full support for viewing air quality sensor data -- info cards on the node detail screen, a dedicated log screen with interactive charts, and CSV export.Implements the design guidance from meshtastic/design#51 and meshtastic/design#53 (Oscar's recommendations for CO2 severity thresholds and thin-line charts).
Approach
air_quality_metricsBLOB column toNodeEntitywith Room auto-migration (v38 -> v39). Follows the same serialized-proto pattern asenvironment_metricsandpower_metrics.TelemetryPacketHandlerImplto process theair_quality_metricsoneof variant and persist it on the node entity.AirQualityMetricscomposable on the node detail screen showing PM1.0, PM2.5, PM10, and CO2 with color-coded CO2 severity (Good/Stuffy/Poor/Unsafe/Evacuate thresholds per Oscar's guidance).NodeDetailRoute.AirQualityMetricswith navigation wired up.Notable decisions
Co2Severityenum incore:uiwith color thresholds: <400 Good, <1000 Stuffy, <2000 Poor, <5000 Unsafe, >=5000 Evacuate.takeIf { it != 0 }) is a known trade-off with proto3 semantics -- legitimate 0 readings are hidden, but absent sensors don't show misleading zeros.@Suppress("CyclomaticComplexMethod")on CSV export and@Suppress("LongMethod")on the chart composable are intentional -- these are inherently complex but linear functions.Verification
spotlessApply+detekt-- cleanassembleDebug-- compilestest+allTests-- all passing