android: Include charging state in battery updates to phone
parent
a1bcc2f9a3
commit
6315a192d6
|
|
@ -5,3 +5,4 @@
|
||||||
0.04: Android icon now goes to settings page with 'find phone'
|
0.04: Android icon now goes to settings page with 'find phone'
|
||||||
0.05: Fix handling of message actions
|
0.05: Fix handling of message actions
|
||||||
0.06: Option to keep messages after a disconnect (default false) (fix #1186)
|
0.06: Option to keep messages after a disconnect (default false) (fix #1186)
|
||||||
|
0.07: Include charging state in battery updates to phone
|
||||||
|
|
|
||||||
|
|
@ -50,8 +50,9 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
// Battery monitor
|
// 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));
|
NRF.on("connect", () => setTimeout(sendBattery, 2000));
|
||||||
|
Bangle.on("charging", sendBattery);
|
||||||
if (!settings.keep)
|
if (!settings.keep)
|
||||||
NRF.on("disconnect", () => require("messages").clearAll()); // remove all messages on disconnect
|
NRF.on("disconnect", () => require("messages").clearAll()); // remove all messages on disconnect
|
||||||
setInterval(sendBattery, 10*60*1000);
|
setInterval(sendBattery, 10*60*1000);
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
"id": "android",
|
"id": "android",
|
||||||
"name": "Android Integration",
|
"name": "Android Integration",
|
||||||
"shortName": "Android",
|
"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.",
|
"description": "Display notifications/music/etc sent from the Gadgetbridge app on Android. This replaces the old 'Gadgetbridge' Bangle.js widget.",
|
||||||
"icon": "app.png",
|
"icon": "app.png",
|
||||||
"tags": "tool,system,messages,notifications,gadgetbridge",
|
"tags": "tool,system,messages,notifications,gadgetbridge",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue