Update widget.js

master^2
RKBoss6 2025-07-26 09:55:52 -04:00 committed by GitHub
parent c09e29b478
commit 45df9b3cfa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 42 additions and 39 deletions

View File

@ -1,9 +1,5 @@
(function(){
WIDGETS["widsmartbatt"] = {
area: "tr",
width: 30,
draw: draw
};
const intervalLow = 30000; // update interval when not charging
const intervalHigh = 30000; // faster update when charging
var showPercent = false;
@ -60,7 +56,14 @@
if (Bangle.isCharging()) changeInterval(id, intervalHigh);
else changeInterval(id, intervalLow);
}
WIDGETS["widsmartbatt"] = {
area: "tr",
width: 30,
draw: function() {
// Call your drawing function
draw();
}
};
// Touch to temporarily show battery percent
Bangle.on("touch", function (_btn, xy) {