feat(environment): add 1-Wire multi-thermometer (DS18B20) display support#5130
Merged
jamesarich merged 2 commits intomeshtastic:mainfrom Apr 15, 2026
Merged
Conversation
…port Add charting, detail card display, and CSV export for up to 8 1-Wire temperature sensor channels from the environment_metrics.one_wire_temperature repeated field. - EnvironmentMetricsState: ONE_WIRE_TEMP_1..8 enum entries with getOrNull() access (safely returns null when firmware does not populate the field) - EnvironmentCharts: LEGEND_DATA_4 with per-channel labels and distinct colours - CommonCharts: LegendData.labelOverride for per-instance legend labels - EnvironmentMetrics: OneWireTemperatureDisplay composable in the detail card - EnvironmentMetrics component: inline 1-Wire chip display with temp formatting - MetricsViewModel: Fahrenheit conversion for one_wire_temperature in CSV export No version gating needed — the proto field defaults to an empty list on older firmware, so the UI elements are naturally hidden when no data is reported.
Collaborator
Author
|
Wow! That's nice! 👏 |
Replace hardcoded one-wire temperature indices (0-7) with a loop over ONE_WIRE_SENSOR_COUNT constant to fix CyclomaticComplexMethod and MagicNumber detekt violations. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Summary
one_wire_temperaturerepeated field inEnvironmentMetricsproto1wire_temp_1through1wire_temp_8columnsChanges
core/ui—CustomColors.ktGraphColors:Magenta,SkyBlue,Chartreuse,Coralto avoid color collisions with existing metricsfeature/node— Environment metricsEnvironmentMetricsState.kt: AddedONE_WIRE_TEMP_1..8enum entries with unique colors; graphing data includes per-channel min/max with Fahrenheit awarenessEnvironmentMetrics.kt: AddedOneWireTemperatureDisplaycomposable showing per-channel temperature with color indicatorEnvironmentCharts.kt: AddedLEGEND_DATA_4with per-channel 1-Wire legend labelsCommonCharts.kt: AddedLegendData.labelOverridefor per-instance legend textMetricsViewModel.kt: Fahrenheit conversion forone_wire_temperaturelist; CSV export columnsfeature/node— Inline componentcomponent/EnvironmentMetrics.kt: Inline 1-Wire chip display in node detailcore/resourcesstrings.xml: Addedone_wire_temperaturestring resourceRelated
Notes
one_wire_temperatureproto field defaults to an empty list on older firmware, so nothing displays unless data is presentspotlessCheckandspotlessApply— zero lint violations