dgreif / homebridge-hatch-baby-rest

A homebridge plugin for Hatch Baby Rest night light
MIT License
74 stars 19 forks source link

Stop Noble from loading/being required if a Rest device is not configured #12

Closed eliransapir closed 4 years ago

eliransapir commented 4 years ago

I only have a Rest+, with homebridge running with bare minimum components the system i have it on does not have bluetooth and i get these errors related to loading noble.

ERROR LOADING PLUGIN homebridge-hatch-baby-rest: [4/5/2020, 8:49:27 PM] Error: EAFNOSUPPORT, Address family not supported by protocol at new Hci (/homebridge/node_modules/homebridge-hatch-baby-rest/node_modules/@abandonware/noble/lib/hci-socket/hci.js:74:18) at new NobleBindings (/homebridge/node_modules/homebridge-hatch-baby-rest/node_modules/@abandonware/noble/lib/hci-socket/bindings.js:25:15) at Object.<anonymous> (/homebridge/node_modules/homebridge-hatch-baby-rest/node_modules/@abandonware/noble/lib/hci-socket/bindings.js:546:18) at Module._compile (internal/modules/cjs/loader.js:1158:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10) at Module.load (internal/modules/cjs/loader.js:1002:32) at Function.Module._load (internal/modules/cjs/loader.js:901:14) at Module.require (internal/modules/cjs/loader.js:1044:19) at require (internal/modules/cjs/helpers.js:77:18) at module.exports (/homebridge/node_modules/homebridge-hatch-baby-rest/node_modules/@abandonware/noble/lib/resolve-bindings.js:13:12)

dgreif commented 4 years ago

@eliransapir I didn't realize noble had side-effects just by requiring it. I've got the code change done and will deploy it tonight. Great suggestion!

tpitale commented 4 years ago

I just hit this problem, too. Thanks @dgreif!

dgreif commented 4 years ago

Released in v2.0.1

eliransapir commented 4 years ago

@dgreif thank you! very much appreciated.