Add charging indicator to companion_radio battery icon - #3054
Open
hansimgamr wants to merge 2 commits into
Open
Conversation
Show a small lightning-bolt icon to the left of the battery indicator on the ui-new home screen while the device is externally powered, and a plug icon once the battery reads full. The bolt/plug sits beside the battery so the fill bar stays clean and uninterrupted. When a buzzer is present, the mute icon shifts one slot further left so the two never overlap. Charging state is derived from board.isExternalPowered(), so this works on any board that reports external power (e.g. the nRF52 VBUS-detect path). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Boards without a charge-complete signal only infer "full" from voltage, and a real pack rarely reads the full BATT_MAX_MILLIVOLTS (4.2V), so the plug icon was effectively never shown. Treat "full" as a high band (>= 95%) so the plug appears when the battery is charged rather than requiring an exact 100%. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.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.
Adds a charging indicator to the
ui-newcompanion_radio home screen. While the device is externally powered, a small lightning-bolt icon is drawn just to the left of the battery indicator; once the battery reads full it switches to a plug icon.The icon sits beside the battery rather than over it, so the fill bar stays clean and uninterrupted at every charge level. When a buzzer is present, the mute icon shifts one slot further left so the two never overlap.
How
board.isExternalPowered(), so this works on any board that reports external power (e.g. the nRF52 VBUS-detect path).charging_icon,plug_icon) inicons.h.UIColortheme (title_txt).Testing
Built and flashed on a Heltec T114 (
Heltec_t114_companion_radio_ble). Bolt appears on USB power, plug appears at 100%, and the battery bar is unaffected when running on battery.🤖 Generated with Claude Code