widbat 0.08: Ensure battery updates every 60s even if LCD was on at boot and stays on

master
Gordon Williams 2021-08-25 08:45:09 +01:00
parent 397fce2842
commit 0d7bddddde
3 changed files with 3 additions and 2 deletions

View File

@ -616,7 +616,7 @@
{ "id": "widbat",
"name": "Battery Level Widget",
"icon": "widget.png",
"version":"0.07",
"version":"0.08",
"description": "Show the current battery level and charging status in the top right of the clock",
"tags": "widget,battery,b2",
"type":"widget",

View File

@ -4,3 +4,4 @@
0.05: Fix regression stopping correct widget updates
0.06: Use 'g.theme' (requires bootloader 0.23)
0.07: Move CHARGING variable to more readable string
0.08: Ensure battery updates every 60s even if LCD was on at boot and stays on

View File

@ -23,7 +23,7 @@
Bangle.drawWidgets(); // relayout widgets
g.flip();
});
var batteryInterval;
var batteryInterval = Bangle.isLCDOn() ? setInterval(()=>WIDGETS["bat"].draw(), 60000) : undefined;
Bangle.on('lcdPower', function(on) {
if (on) {
WIDGETS["bat"].draw();