gbridge: report battery status more often
Make the gbridge widget report battery status - every 10 minutes - 2 seconds after a new bluetooth connection is initiatedmaster
parent
31e56b23ed
commit
9ebb718cc2
|
|
@ -95,7 +95,7 @@
|
||||||
{ "id": "gbridge",
|
{ "id": "gbridge",
|
||||||
"name": "Gadgetbridge",
|
"name": "Gadgetbridge",
|
||||||
"icon": "app.png",
|
"icon": "app.png",
|
||||||
"version":"0.10",
|
"version":"0.11",
|
||||||
"description": "The default notification handler for Gadgetbridge notifications from Android",
|
"description": "The default notification handler for Gadgetbridge notifications from Android",
|
||||||
"tags": "tool,system,android,widget",
|
"tags": "tool,system,android,widget",
|
||||||
"type":"widget",
|
"type":"widget",
|
||||||
|
|
|
||||||
|
|
@ -9,3 +9,4 @@
|
||||||
0.08: Don't turn on LCD at start of every song
|
0.08: Don't turn on LCD at start of every song
|
||||||
0.09: Update Bluetooth connection state automatically
|
0.09: Update Bluetooth connection state automatically
|
||||||
0.10: Make widget play well with other Gadgetbridge widgets/apps
|
0.10: Make widget play well with other Gadgetbridge widgets/apps
|
||||||
|
0.11: Report battery status on connect and at regular intervals
|
||||||
|
|
|
||||||
|
|
@ -197,5 +197,11 @@
|
||||||
|
|
||||||
WIDGETS["gbridgew"] = { area: "tl", width: 24, draw: draw };
|
WIDGETS["gbridgew"] = { area: "tl", width: 24, draw: draw };
|
||||||
|
|
||||||
|
function sendBattery() {
|
||||||
gbSend({ t: "status", bat: E.getBattery() });
|
gbSend({ t: "status", bat: E.getBattery() });
|
||||||
|
}
|
||||||
|
|
||||||
|
NRF.on("connect", () => setTimeout(sendBattery, 2000));
|
||||||
|
setInterval(sendBattery, 10*60*1000);
|
||||||
|
sendBattery();
|
||||||
})();
|
})();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue