Skip to content

Commit b6347bc

Browse files
committed
bthome 0.07: Create new button IDs from 0 (so we don't have one unused button constantly advertised!)
1 parent cfa6f42 commit b6347bc

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

apps/bthome/ChangeLog

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@
44
Set 'n' for buttons in Bangle.btHomeData correctly (avoids adding extra buttons on end of advertising)
55
0.04: Fix duplicate button on edit->save
66
0.05: Use the bleAdvert module
7-
0.06: button number can't be 0. Now generates number automatically
7+
0.06: button number can't be 0. Now generates number automatically
8+
0.07: Create new button IDs from 0 (so we don't have one unused button constantly advertised!)

apps/bthome/metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{ "id": "bthome",
22
"name": "BTHome",
33
"shortName":"BTHome",
4-
"version":"0.06",
4+
"version":"0.07",
55
"description": "Allow your Bangle to advertise with BTHome and send events to Home Assistant via Bluetooth",
66
"icon": "icon.png",
77
"type": "app",

apps/bthome/settings.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
// Get id number for button that is sent to bthome
1515
function getNewIdNumber(){
16-
return [1, 2, 3, 4, 5, 6, 7, 8, 9].find(id => settings.buttons.every(button => id != button.n));
16+
return [0, 1, 2, 3, 4, 5, 6, 7, 8, 9].find(id => settings.buttons.every(button => id != button.n));
1717
}
1818

1919
function showButtonMenu(button, isNew) {

0 commit comments

Comments
 (0)