diff --git a/apps.json b/apps.json index 04c2f637d..ff13cdff6 100644 --- a/apps.json +++ b/apps.json @@ -95,7 +95,7 @@ { "id": "gbridge", "name": "Gadgetbridge", "icon": "app.png", - "version":"0.10", + "version":"0.11", "description": "The default notification handler for Gadgetbridge notifications from Android", "tags": "tool,system,android,widget", "type":"widget", diff --git a/apps/gbridge/ChangeLog b/apps/gbridge/ChangeLog index f23a4eb6d..f66040388 100644 --- a/apps/gbridge/ChangeLog +++ b/apps/gbridge/ChangeLog @@ -9,3 +9,4 @@ 0.08: Don't turn on LCD at start of every song 0.09: Update Bluetooth connection state automatically 0.10: Make widget play well with other Gadgetbridge widgets/apps +0.11: Report battery status on connect and at regular intervals diff --git a/apps/gbridge/widget.js b/apps/gbridge/widget.js index 0d0f2468d..ae7d0f8fa 100644 --- a/apps/gbridge/widget.js +++ b/apps/gbridge/widget.js @@ -197,5 +197,11 @@ WIDGETS["gbridgew"] = { area: "tl", width: 24, draw: draw }; - gbSend({ t: "status", bat: E.getBattery() }); + function sendBattery() { + gbSend({ t: "status", bat: E.getBattery() }); + } + + NRF.on("connect", () => setTimeout(sendBattery, 2000)); + setInterval(sendBattery, 10*60*1000); + sendBattery(); })();