Skip to content

Commit

Permalink
Merge pull request #3503 from bobrippling/feat/battpwr-charging
Browse files Browse the repository at this point in the history
widbattpwr: show percentage if charging
  • Loading branch information
bobrippling authored Jul 13, 2024
2 parents 1e82772 + 35bc00e commit e9059c7
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions apps/widbattpwr/ChangeLog
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
0.01: Initial fork from hwid_a_battery_widget
0.02: Show battery percentage (instead of power) if charging
4 changes: 4 additions & 0 deletions apps/widbattpwr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

Show the time remaining at the current power consumption, and battery percentage via shading of the text and a percentage bar.

Battery percentage can be seen:
- Temporarily by tapping the widget
- By charging the watch

Requires firmware 2v23 or above.

This is a copy of `hwid_a_battery_widget` (that being a copy of `wid_a_battery_widget`).
Expand Down
2 changes: 1 addition & 1 deletion apps/widbattpwr/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "Battery power and percentage widget",
"shortName": "Batt Pwr",
"icon": "widget.png",
"version": "0.01",
"version": "0.02",
"type": "widget",
"supports": ["BANGLEJS2"],
"readme": "README.md",
Expand Down
2 changes: 1 addition & 1 deletion apps/widbattpwr/widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
g.setFont("Vector", 16);
{
var txt = void 0;
if (showPct) {
if (showPct || Bangle.isCharging()) {
txt = "".concat(batt, "%");
}
else {
Expand Down
2 changes: 1 addition & 1 deletion apps/widbattpwr/widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
g.setFont("Vector", 16);
{
let txt;
if(showPct){
if(showPct || Bangle.isCharging()){
txt = `${batt}%`;
}else{
// 175mAh, scaled based on battery (batt/100), scaled down based on usage
Expand Down

0 comments on commit e9059c7

Please sign in to comment.