dgreif / homebridge-hatch-baby-rest

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

Missing Bluetooth Device Crashes Homebridge #47

Closed dwwkelly closed 3 years ago

dwwkelly commented 3 years ago

I didn't realize that I disabled bluetooth on my RPi and when I went to run this plugin it crashed Homebridge:

[2/23/2021, 7:15:01 PM] [HatchBabyRest] Waiting for bluetooth to power on (node:15389) UnhandledPromiseRejectionWarning: Error: ENODEV, No such device at Hci.init (/usr/local/lib/node_modules/homebridge-hatch-baby-rest/node_modules/@abandonware/noble/lib/hci-socket/hci.js:114:35) at NobleBindings.init (/usr/local/lib/node_modules/homebridge-hatch-baby-rest/node_modules/@abandonware/noble/lib/hci-socket/bindings.js:82:13) at Noble.get (/usr/local/lib/node_modules/homebridge-hatch-baby-rest/node_modules/@abandonware/noble/lib/noble.js:72:26) at HatchBabyRest.<anonymous> (/usr/local/lib/node_modules/homebridge-hatch-baby-rest/lib/hatch-baby-rest.js:68:56) at Generator.next (<anonymous>) at /usr/local/lib/node_modules/homebridge-hatch-baby-rest/lib/hatch-baby-rest.js:13:71 at new Promise (<anonymous>) at __awaiter (/usr/local/lib/node_modules/homebridge-hatch-baby-rest/lib/hatch-baby-rest.js:9:12) at HatchBabyRest.getPeripheralByAddress (/usr/local/lib/node_modules/homebridge-hatch-baby-rest/lib/hatch-baby-rest.js:65:16) at new HatchBabyRest (/usr/local/lib/node_modules/homebridge-hatch-baby-rest/lib/hatch-baby-rest.js:31:39) (Usenode --trace-warnings ...to show where the warning was created) (node:15389) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag--unhandled-rejections=strict(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)

dgreif commented 3 years ago

Good to know. I don't think this is worth adding a fix for at the moment because you need to know bluetooth failed if you turn it off