mirror of https://github.com/espruino/BangleApps
Initial version
parent
ccf6c2a7e5
commit
e9c8a7f67f
|
@ -0,0 +1 @@
|
||||||
|
0.01: Initial release.
|
|
@ -0,0 +1,13 @@
|
||||||
|
# BLE BTHome Battery Service
|
||||||
|
|
||||||
|
Broadcasts battery remaining percentage over BLE using the BTHome protocol
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
This boot code runs in the background and has no user interface.
|
||||||
|
|
||||||
|
Based on [BootGATTBat](https://github.com/espruino/BangleApps/tree/master/apps/bootgattbat) by [Jonathan Jefferies](https://github.com/jjok).
|
||||||
|
|
||||||
|
## Creator
|
||||||
|
|
||||||
|
[Deirdre O'Byrne](https://github.com/deirdreobyrne)
|
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
|
@ -0,0 +1,10 @@
|
||||||
|
(() => {
|
||||||
|
var btHomeSequenceNo = 0;
|
||||||
|
function advertiseBTHomeBattery() {
|
||||||
|
require("ble_advert").set(0xFCD2, [0x40,0x00,btHomeSequenceNo,0x01,E.getBattery()]);
|
||||||
|
btHomeSequenceNo = (btHomeSequenceNo + 1) & 255;
|
||||||
|
}
|
||||||
|
|
||||||
|
setInterval(advertiseBTHomeBattery, 5 * 60 * 1000);
|
||||||
|
advertiseBattery();
|
||||||
|
})();
|
|
@ -0,0 +1,15 @@
|
||||||
|
{
|
||||||
|
"id": "bootbthomebatt",
|
||||||
|
"name": "BLE BTHome Battery Service",
|
||||||
|
"shortName": "BTHome Battery Service",
|
||||||
|
"version": "0.01",
|
||||||
|
"description": "Broadcasts battery remaining over bluetooth using the BTHome protocol.\n",
|
||||||
|
"icon": "bluetooth.png",
|
||||||
|
"type": "bootloader",
|
||||||
|
"tags": "battery,ble,bluetooth,bthome",
|
||||||
|
"supports": ["BANGLEJS2"],
|
||||||
|
"readme": "README.md",
|
||||||
|
"storage": [
|
||||||
|
{"name":"bthomebat.boot.js","url":"boot.js"}
|
||||||
|
]
|
||||||
|
}
|
Loading…
Reference in New Issue