trympet / homebridge-volvo

Volvo plugin for Homebridge
https://npm.im/homebridge-volvo
Apache License 2.0
26 stars 6 forks source link

TypeError: Cannot read property 'honkAndBlink' of undefined #4

Closed DJay-X closed 4 years ago

DJay-X commented 4 years ago

Hey @trympet Thanks for bringing your plugin to npm. Manuell Installation worked without an error.

pi@raspberrypi-3BPlus:~ $ sudo npm install -g homebridge-volvo
+ homebridge-volvo@1.0.0
added 37 packages from 69 contributors in 65.029s

However, when starting homebridge this error is in the log and Homebridge is crashing.

Maybe you have an idea? Volvo V90 (Early 2020)

Thanks in advance.

Jul 13 17:23:21 raspberrypi-3BPlus homebridge[25674]: [2020-7-13 17:23:21] TypeError: Cannot read property 'honkAndBlink' of undefined
Jul 13 17:23:21 raspberrypi-3BPlus homebridge[25674]:     at Object.getSensorNames (/usr/local/lib/node_modules/homebridge-volvo/src/helpers.ts:45:3)
Jul 13 17:23:21 raspberrypi-3BPlus homebridge[25674]:     at new VolvoPlatform (/usr/local/lib/node_modules/homebridge-volvo/src/index.ts:30:24)
Jul 13 17:23:21 raspberrypi-3BPlus homebridge[25674]:     at /usr/local/lib/node_modules/homebridge/src/server.ts:357:50
Jul 13 17:23:21 raspberrypi-3BPlus homebridge[25674]:     at Array.forEach (<anonymous>)
Jul 13 17:23:21 raspberrypi-3BPlus homebridge[25674]:     at Server._loadAccessories (/usr/local/lib/node_modules/homebridge/src/server.ts:330:29)
Jul 13 17:23:21 raspberrypi-3BPlus homebridge[25674]:     at Server.start (/usr/local/lib/node_modules/homebridge/src/server.ts:156:12)
Jul 13 17:23:21 raspberrypi-3BPlus homebridge[25674]:     at cli (/usr/local/lib/node_modules/homebridge/src/cli.ts:80:10)
Jul 13 17:23:21 raspberrypi-3BPlus homebridge[25674]:     at Object.<anonymous> (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22)
Jul 13 17:23:21 raspberrypi-3BPlus homebridge[25674]:     at Module._compile (internal/modules/cjs/loader.js:1138:30)
Jul 13 17:23:21 raspberrypi-3BPlus homebridge[25674]:     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
Jul 13 17:23:21 raspberrypi-3BPlus homebridge[25674]: [2020-7-13 17:23:21] Got SIGTERM, shutting down Homebridge...
trympet commented 4 years ago

Hello. Bad input validation. Fixed in latest release. run npm install -g homebridge-volvo to update to latest release 🙌. config-ui-x support has also been added now; also proper error handling, so no more crashes (hopefully).

DJay-X commented 4 years ago

👍 Looking good. I have to try in the next days.. Thanks a lot.

Jul 14 14:12:10 raspberrypi-3BPlus homebridge[4239]: [2020-7-14 14:12:10] [Volvo] Initializing Volvo accessory...
Jul 14 14:12:10 raspberrypi-3BPlus homebridge[4239]: [2020-7-14 14:12:10] [Volvo] Starting homebridge-volvo
Jul 14 14:12:12 raspberrypi-3BPlus homebridge[4239]: [2020-7-14 14:12:12] [Volvo]
Jul 14 14:12:12 raspberrypi-3BPlus homebridge[4239]: Features available:
Jul 14 14:12:12 raspberrypi-3BPlus homebridge[4239]:         carLocatorSupported
Jul 14 14:12:12 raspberrypi-3BPlus homebridge[4239]:         honkAndOrBlink
Jul 14 14:12:12 raspberrypi-3BPlus homebridge[4239]:         honkAndBlink
Jul 14 14:12:12 raspberrypi-3BPlus homebridge[4239]:         unlockSupported
Jul 14 14:12:12 raspberrypi-3BPlus homebridge[4239]:         lockSupported
Jul 14 14:12:12 raspberrypi-3BPlus homebridge[4239]:         preclimatizationSupported
Jul 14 14:12:12 raspberrypi-3BPlus homebridge[4239]: [2020-7-14 14:12:12] [Volvo]
Jul 14 14:12:12 raspberrypi-3BPlus homebridge[4239]: Features enabled:
Jul 14 14:12:12 raspberrypi-3BPlus homebridge[4239]:         carLocatorSupported
Jul 14 14:12:12 raspberrypi-3BPlus homebridge[4239]:         honkAndOrBlink
Jul 14 14:12:12 raspberrypi-3BPlus homebridge[4239]:         honkAndBlink
Jul 14 14:12:12 raspberrypi-3BPlus homebridge[4239]:         unlockSupported
Jul 14 14:12:12 raspberrypi-3BPlus homebridge[4239]:         lockSupported
Jul 14 14:12:12 raspberrypi-3BPlus homebridge[4239]:         preclimatizationSupported
Jul 14 14:12:12 raspberrypi-3BPlus homebridge[4239]: [2020-7-14 14:12:12] [Volvo] Got vehicle 2020 V90 with registration number X-XX1234.