Remove outdated update changes

master^2
RKBoss6 2025-07-30 11:13:07 -04:00 committed by GitHub
parent 751af4a8c0
commit 79dcbd7fd1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 7 deletions

View File

@ -1,7 +1,5 @@
(function(){ (function(){
const intervalLow = 30000; // update interval when not charging
const intervalHigh = 30000; // faster update when charging
var showPercent = false; var showPercent = false;
const width = 40; const width = 40;
const height = 24; const height = 24;
@ -57,8 +55,7 @@
g.setFont('6x8'); g.setFont('6x8');
g.drawString(txt, x + 14, y + 10); g.drawString(txt, x + 14, y + 10);
if (Bangle.isCharging()) changeInterval(id, intervalHigh);
else changeInterval(id, intervalLow);
} }
WIDGETS["widsmartbatt"] = { WIDGETS["widsmartbatt"] = {
area: "tr", area: "tr",
@ -80,6 +77,7 @@
if (w.x - oversize <= x && x < w.x + width + oversize if (w.x - oversize <= x && x < w.x + width + oversize
&& w.y - oversize <= y && y < w.y + height + oversize) { && w.y - oversize <= y && y < w.y + height + oversize) {
E.stopEventPropagation && E.stopEventPropagation(); E.stopEventPropagation && E.stopEventPropagation();
Bangle.buzz(20);
showPercent = true; showPercent = true;
setTimeout(() => { setTimeout(() => {
showPercent = false; showPercent = false;
@ -93,8 +91,8 @@
Bangle.on('charging', function () { Bangle.on('charging', function () {
WIDGETS["widsmartbatt"].draw(); WIDGETS["widsmartbatt"].draw();
}); });
//draw once per minute...
var id = setInterval(() => WIDGETS["widsmartbatt"].draw(), intervalLow); var id = setInterval(() => WIDGETS["widsmartbatt"].draw(), 60000);
})(); })();