From 29c6e385e223b1e0bfd7058a4de5c7ba6be497c0 Mon Sep 17 00:00:00 2001 From: deirdreobyrne Date: Wed, 26 Jun 2024 19:30:14 +0100 Subject: [PATCH] Cleanup --- apps/bootbthomebatt/README.md | 4 +--- apps/bootbthomebatt/boot.js | 12 +----------- apps/bootbthomebatt/metadata.json | 2 +- 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/apps/bootbthomebatt/README.md b/apps/bootbthomebatt/README.md index b3e10e1cfe9..79c379f33ba 100644 --- a/apps/bootbthomebatt/README.md +++ b/apps/bootbthomebatt/README.md @@ -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) diff --git a/apps/bootbthomebatt/boot.js b/apps/bootbthomebatt/boot.js index e13135b45ef..64275ed312d 100644 --- a/apps/bootbthomebatt/boot.js +++ b/apps/bootbthomebatt/boot.js @@ -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; diff --git a/apps/bootbthomebatt/metadata.json b/apps/bootbthomebatt/metadata.json index 9deebfdc071..0992edc2451 100644 --- a/apps/bootbthomebatt/metadata.json +++ b/apps/bootbthomebatt/metadata.json @@ -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",