gbridge: Include charging state in battery updates to phone
parent
6315a192d6
commit
f131426976
|
|
@ -26,3 +26,4 @@
|
|||
0.24: tag HRM power requests to allow this to work alongside other widgets/apps (fix #799)
|
||||
0.25: workaround call notification
|
||||
Fix inflated step number
|
||||
0.26: Include charging status in battery updates to phone
|
||||
|
|
|
|||
|
|
@ -11,11 +11,12 @@ t can be one of "info", "warn", "error"
|
|||
## report battery level
|
||||
|
||||
```
|
||||
{ "t": "status", "bat": 30, "volt": 30 }
|
||||
{ "t": "status", "bat": 30, "volt": 30, "chg": 0 }
|
||||
```
|
||||
|
||||
* bat is in range 0 to 100
|
||||
* volt is optional and should be greater than 0
|
||||
* chg is optional and should be either 0 or 1 to indicate the watch is charging
|
||||
|
||||
## find phone
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"id": "gbridge",
|
||||
"name": "Gadgetbridge",
|
||||
"version": "0.25",
|
||||
"version": "0.26",
|
||||
"description": "(NOT RECOMMENDED) Displays Gadgetbridge notifications from Android. Please use the 'Android' Bangle.js app instead.",
|
||||
"icon": "app.png",
|
||||
"type": "widget",
|
||||
|
|
|
|||
|
|
@ -256,7 +256,7 @@
|
|||
}
|
||||
|
||||
function sendBattery() {
|
||||
gbSend({ t: "status", bat: E.getBattery() });
|
||||
gbSend({ t: "status", bat: E.getBattery(), chg: Bangle.isCharging()?1:0 });
|
||||
}
|
||||
|
||||
// Send a summary of activity to Gadgetbridge
|
||||
|
|
@ -268,6 +268,7 @@
|
|||
|
||||
// Battery monitor
|
||||
NRF.on("connect", () => setTimeout(sendBattery, 2000));
|
||||
Bangle.on("charging", sendBattery);
|
||||
setInterval(sendBattery, 10*60*1000);
|
||||
sendBattery();
|
||||
// Activity monitor
|
||||
|
|
|
|||
Loading…
Reference in New Issue