feat(settings): Add firmware capability checks for settings#4403
Merged
Conversation
This commit introduces firmware capability checks to dynamically show or hide certain settings based on the connected device's firmware version.
- **`Capabilities.kt`**:
- Added `supportsStatusMessage` (for firmware >= 2.7.17).
- Added `supportsSecondaryChannelLocation` (for firmware >= 2.6.10).
- **Channel Configuration**:
- The `ChannelConfigScreen` and `ChannelLegendDialog` now use the new `supportsSecondaryChannelLocation` capability to determine if location sharing on secondary channels is supported, replacing direct version string comparisons.
- **Module Routes**:
- The `ModuleRoute` enum now includes an `isSupported` lambda that checks device capabilities.
- The Status Message module will now only be displayed if the firmware supports it.
- **Tests**:
- Added unit tests for the new capability checks.
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4403 +/- ##
=====================================
Coverage 8.35% 8.36%
=====================================
Files 418 418
Lines 14311 14318 +7
Branches 2076 2078 +2
=====================================
+ Hits 1195 1197 +2
- Misses 12885 12890 +5
Partials 231 231 ☔ View full report in Codecov by Sentry. |
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.
This commit introduces firmware capability checks to dynamically show or hide certain settings based on the connected device's firmware version.
Capabilities.kt:supportsStatusMessage(for firmware >= 2.7.17).supportsSecondaryChannelLocation(for firmware >= 2.6.10).ChannelConfigScreenandChannelLegendDialognow use the newsupportsSecondaryChannelLocationcapability to determine if location sharing on secondary channels is supported, replacing direct version string comparisons.ModuleRouteenum now includes anisSupportedlambda that checks device capabilities.