Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
deirdreobyrne authored and bobrippling committed Jun 26, 2024
1 parent 3cf61e6 commit 29c6e38
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
4 changes: 1 addition & 3 deletions apps/bootbthomebatt/README.md
Original file line number Diff line number Diff line change
@@ -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)
12 changes: 1 addition & 11 deletions apps/bootbthomebatt/boot.js
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 1 addition & 1 deletion apps/bootbthomebatt/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 29c6e38

Please sign in to comment.