Skip to content

refactor: Add LONG_TURBO ChannelOption and validation test#4039

Merged
jamesarich merged 2 commits into
mainfrom
fix/channel-options
Dec 18, 2025
Merged

refactor: Add LONG_TURBO ChannelOption and validation test#4039
jamesarich merged 2 commits into
mainfrom
fix/channel-options

Conversation

@jamesarich

@jamesarich jamesarich commented Dec 18, 2025

Copy link
Copy Markdown
Collaborator

Adds LONG_TURBO and adds tests to ensure that ModemPreset protobuf changes (both new and removed entries) are addressed in our ChannelOption mappings.

- Adds the `LONG_TURBO` modem preset to the `ChannelOption` enum.
- Includes a new string resource for its label.
- Refactors the `ChannelOption` enum for better readability by grouping presets.
- Adds a companion object with a `from(modemPreset)` helper function and a `DEFAULT` constant.
- Introduces a new unit test (`ChannelOptionTest`) to ensure that every `ModemPreset` from the protobufs has a corresponding `ChannelOption`, preventing future omissions.
Add tests to ensure the mapping between `ChannelOption` and `ModemPreset` is accurate and complete.

These tests verify that:
- There are no extra `ChannelOption` entries for `ModemPreset`s that have been removed.
- Each `ChannelOption` maps to a unique `ModemPreset`, ensuring no duplicate mappings exist.
@jamesarich jamesarich enabled auto-merge December 18, 2025 16:40
@codecov

codecov Bot commented Dec 18, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 84.61538% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.60%. Comparing base (d8a1f88) to head (d532a0a).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
.../kotlin/org/meshtastic/core/model/ChannelOption.kt 84.61% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##            main   #4039      +/-   ##
========================================
+ Coverage   0.56%   0.60%   +0.04%     
========================================
  Files        406     406              
  Lines      24279   24283       +4     
  Branches    3119    3121       +2     
========================================
+ Hits         136     148      +12     
+ Misses     24122   24112      -10     
- Partials      21      23       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jamesarich jamesarich added this pull request to the merge queue Dec 18, 2025
Merged via the queue into main with commit 85435d7 Dec 18, 2025
11 checks passed
@jamesarich jamesarich deleted the fix/channel-options branch December 18, 2025 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix PR tag

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants