howanghk / homebridge-ewelink

Homebridge plugin to control Sonoff relays with OEM firmware
MIT License
81 stars 46 forks source link

Crash if there is a bridge 433 mhz connected to the account #16

Closed dodobardo closed 5 years ago

dodobardo commented 5 years ago

Hello,

Today I tried to configure a bridge 433 mhz with my account, but when I tried to run homebridge I received this exception while listing the devices.

this.webClient.get('/api/user/device', function(err, res, body) { ^

TypeError: Cannot read property 'get' of undefined at eWeLink.getPowerState (/opt/nodejs/lib/node_modules/homebridge-ewelink-max/index.js:440:20) at Characteristic. (/opt/nodejs/lib/node_modules/homebridge-ewelink-max/index.js:316:26) at emitThree (events.js:136:13) at Characteristic.emit (events.js:217:7) at Characteristic.getValue (/opt/nodejs/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Characteristic.js:163:10) at Bridge. (/opt/nodejs/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:760:20) at Array.forEach () at Bridge.Accessory._handleGetCharacteristics (/opt/nodejs/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:724:8) at emitMany (events.js:147:13) at HAPServer.emit (events.js:224:7)

howanghk commented 5 years ago

Hi @dodobardo , I have released a new version 0.1.13 which should fix the crash.

dodobardo commented 5 years ago

Wow really fast fix, now I will try to add the alarm sensors to the code.