mirror of https://github.com/espruino/BangleApps
Cleanup
parent
e0b3bb0cbe
commit
1a22dbbc5c
|
@ -1,13 +1,11 @@
|
|||
# BLE BTHome Battery Service
|
||||
|
||||
Broadcasts battery remaining percentage over BLE using the [BTHome protocol](https://bthome.io/)
|
||||
Broadcasts battery remaining percentage over BLE using the [BTHome protocol](https://bthome.io/) - which makes for easy integration into [Home Assistant](https://www.home-assistant.io/)
|
||||
|
||||
## 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)
|
||||
|
|
|
@ -1,17 +1,7 @@
|
|||
var btHomeBatterySequence = 0;
|
||||
|
||||
function advertiseBTHomeBattery() {
|
||||
var advert = [ 0x40, /* BTHome Device Information
|
||||
bit 0: "Encryption flag"
|
||||
bit 1-4: "Reserved for future use"
|
||||
bit 5-7: "BTHome Version" */
|
||||
|
||||
0x00, // Sequence number
|
||||
btHomeBatterySequence,
|
||||
|
||||
0x01, // Battery, 8 bit
|
||||
E.getBattery()
|
||||
];
|
||||
var advert = [0x40, 0x00, btHomeBatterySequence, 0x01, E.getBattery()];
|
||||
|
||||
if(Array.isArray(Bangle.bleAdvert)){
|
||||
var found = false;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
"name": "BLE BTHome Battery Service",
|
||||
"shortName": "BTHome Battery Service",
|
||||
"version": "0.01",
|
||||
"description": "Broadcasts battery remaining over bluetooth using the BTHome protocol.\n",
|
||||
"description": "Broadcasts battery remaining over bluetooth using the BTHome protocol - makes for easy integration with Home Assistant.\n",
|
||||
"icon": "bluetooth.png",
|
||||
"type": "bootloader",
|
||||
"tags": "battery,ble,bluetooth,bthome",
|
||||
|
|
Loading…
Reference in New Issue