android: Include charging state in battery updates to phone

master
Richard de Boer 2022-02-01 21:10:15 +01:00
parent a1bcc2f9a3
commit 6315a192d6
No known key found for this signature in database
GPG Key ID: 8721727971871937
3 changed files with 4 additions and 2 deletions

View File

@ -5,3 +5,4 @@
0.04: Android icon now goes to settings page with 'find phone'
0.05: Fix handling of message actions
0.06: Option to keep messages after a disconnect (default false) (fix #1186)
0.07: Include charging state in battery updates to phone

View File

@ -50,8 +50,9 @@
};
// Battery monitor
function sendBattery() { gbSend({ t: "status", bat: E.getBattery() }); }
function sendBattery() { gbSend({ t: "status", bat: E.getBattery(), chg: Bangle.isCharging()?1:0 }); }
NRF.on("connect", () => setTimeout(sendBattery, 2000));
Bangle.on("charging", sendBattery);
if (!settings.keep)
NRF.on("disconnect", () => require("messages").clearAll()); // remove all messages on disconnect
setInterval(sendBattery, 10*60*1000);

View File

@ -2,7 +2,7 @@
"id": "android",
"name": "Android Integration",
"shortName": "Android",
"version": "0.06",
"version": "0.07",
"description": "Display notifications/music/etc sent from the Gadgetbridge app on Android. This replaces the old 'Gadgetbridge' Bangle.js widget.",
"icon": "app.png",
"tags": "tool,system,messages,notifications,gadgetbridge",