Skip to content

Commit 3f54b38

Browse files
authored
Update switchbot-ble.ts
1 parent d3d9ad6 commit 3f54b38

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/switchbot-ble.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,8 @@ export class SwitchBotBLE extends EventEmitter {
273273

274274
const p = { model: params.model || '', id: params.id || '' }
275275

276+
this.noble.removeAllListeners('discover')
277+
276278
this.noble.on('discover', async (peripheral: NobleTypes['peripheral']) => {
277279
const ad = await Advertising.parse(peripheral, this.log.bind(this))
278280
this.emit('debug', `Advertisement: ${ad}`)

0 commit comments

Comments
 (0)