Skip to content

Commit aadc1ed

Browse files
committed
fix bthome events
1 parent f771d13 commit aadc1ed

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

modules/BTHome.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2023 Gordon Williams. See the file LICENSE for copying permission. */
1+
/* Copyright (c) 2025 Gordon Williams. See the file LICENSE for copying permission. */
22
/*
33
Module for creating BTHome.io compatible Advertisements
44
@@ -34,8 +34,8 @@ exports.getAdvertisement = function(devices) {
3434
text : e => { let t = ""+e.v; return [ 0x53, t.length ].concat(t.split("").map(c=>c.charCodeAt())); }, // text string
3535
button_event : e => {
3636
const events=["none","press","double_press","triple_press","long_press","long_double_press","long_triple_press"];
37-
if (!events.includes(e, 1)) throw new Error(`Unknown event type ${E.toJS(e, 1)}`);
38-
return [0x3A, events.indexOf(e, 1)];
37+
if (!events.includes(e.v, 1)) throw new Error(`Unknown event type ${E.toJS(e.v, 1)}`);
38+
return [0x3A, events.indexOf(e.v, 1)];
3939
},
4040
dimmer_event : e => {
4141
var n = 0;

0 commit comments

Comments
 (0)