Skip to content

Commit

Permalink
Fix noble object initialization on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
lstrojny committed Dec 30, 2022
1 parent 5432228 commit 7a29ec6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/adapters/ble/noble.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const nobleDiscoverPeripherals: BlePeripheralsDiscovery = (
try {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore Type information are foobar’ed
const noble = new Noble({ extended: false }) as typeof Noble
const noble = (typeof Noble === 'function' ? new Noble({ extended: false }) : Noble) as typeof Noble

noble.on('stateChange', (state: string) => {
if (state !== 'poweredOn') {
Expand Down

0 comments on commit 7a29ec6

Please sign in to comment.