Fix repeater battery % inconsistency and add configurable repeater battery chemistry#199
Merged
wel97459 merged 4 commits intoFeb 21, 2026
Conversation
…ry setting - Add shared battery percent utility used by connector, repeater status, and telemetry - Add repeater-specific battery chemistry persistence and service accessors - Add repeater chemistry selector in Repeater Hub - Ensure telemetry and status compute percentages consistently from same chemistry - Add focused battery utility tests Refs #116 Refs #174
Contributor
Author
Contributor
Author
Collaborator
Contributor
Author
|
This fix for #174 fully unifies repeater battery display between Repeater Status and Telemetry by introducing a shared battery snapshot source in MeshCoreConnector. Both screens now publish and consume the same millivolt value, so percentage and voltage formatting are derived from the same canonical data path. Any residual variation (±3%) is due to request timing, not different calculations. It also includes a new feature which allows users to change battery chemistry on repeaters.... #116 |
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
This PR addresses two related repeater battery issues:
What Changed
lib/utils/battery_utils.dartlib/connector/meshcore_connector.dartlib/models/app_settings.dartlib/services/app_settings_service.dartbatteryChemistryByRepeaterIdbatteryChemistryForRepeater,setBatteryChemistryForRepeaterlib/screens/repeater_hub_screen.dartlib/screens/repeater_status_screen.dartlib/screens/telemetry_screen.dartWhy
Previously, status and telemetry used different hardcoded voltage ranges, so battery % differed for the same battery voltage. This PR removes duplicated logic and ensures both screens compute the same value using a user-selected chemistry.
Tests / Validation
test/utils/battery_utils_test.dartflutter analyzepasses for changed filesflutter test test/utils/battery_utils_test.dartpassesNotes
context.l10n), and no new localization keys were introduced.Closes