Add battery chemistry and power state monitoring for repeaters#135
Draft
rsp2k wants to merge 6 commits intozjs81:mainfrom
Draft
Add battery chemistry and power state monitoring for repeaters#135rsp2k wants to merge 6 commits intozjs81:mainfrom
rsp2k wants to merge 6 commits intozjs81:mainfrom
Conversation
- Add per-repeater battery chemistry setting (NMC, LiFePO4, LiPo) - Create shared battery_utils.dart for voltage-to-percentage calculation - Support optional firmware-reported chemistry (protocol extension at byte 60) - Show lock icon when chemistry is firmware-reported, dropdown when user-configurable - Add l10n string for "Battery Type" label Addresses zjs81#116
- Detect optional chemistry byte at offset 11 in BATT_AND_STORAGE response - Prefer firmware-reported chemistry over user setting - Use shared battery_utils.dart for percentage calculation - Log chemistry type when detected Extends battery chemistry feature to companion radio in addition to repeaters.
- Rename NMC to LiPo as standard for dev boards - Add 'none' option for external power (wall-powered devices) - Add lead acid support (12V solar/off-grid setups) - Protocol: 0x00=none, 0x01=lipo, 0x02=lifepo4, 0x03=leadacid - Add migration for old stored values (nmc/liion -> lipo) - Make return type nullable for 'none' chemistry
- Hide battery type row when chemistry is 'none' (redundant with N/A) - Fix text overflow with Flexible + ellipsis - Shorten label to "No Battery" for cleaner display
- Add Battery Settings dialog showing current voltage/percentage - User chemistry selection now overrides firmware default - Show "Device default: X" hint only for meaningful firmware values - Fix battery percent calculation to use user setting as primary - Shorten label from "Battery Chemistry" to "Type"
Parse and display power source information from protocol extension bytes: - USB connection status (blue icon) - Solar connection status (orange icon) - Charging indicator (green icon) - Input voltage display Protocol bytes: frame[61]=power_state flags, frame[62-63]=input_mv (LE uint16) Backward compatible: row hidden when firmware doesn't send extension bytes.
Collaborator
|
I love the idea but this recreates some existing functionality that should be pulled out into a helper and reused to remain consistent. meshcore-open/lib/connector/meshcore_connector.dart Lines 220 to 247 in 72f0aa7 |
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
Power State Display
Test plan
Addresses #116