rooi / homebridge-lightwaverf

LightwaveRF plugin for HomeBridge
9 stars 7 forks source link

Crash when running scenes with more than 13 devices #12

Closed Cardo1 closed 7 years ago

Cardo1 commented 7 years ago

When running a scene with more than 13 Lightwaverf devices, the Lightwaverf plugin crashes Homebridge with the following error:

/usr/local/lib/node_modules/homebridge-lightwaverf/node_modules/lightwaverf/index.js:225 if(this.queue.length > 10) this.queue.clear(); ^

TypeError: this.queue.clear is not a function at LightwaveRF.exec (/usr/local/lib/node_modules/homebridge-lightwaverf/node_modules/lightwaverf/index.js:225:43) at LightwaveRF.turnDeviceOff (/usr/local/lib/node_modules/homebridge-lightwaverf/node_modules/lightwaverf/index.js:150:7) at Object.LightWaveRFAccessory.executeChange (/usr/local/lib/node_modules/homebridge-lightwaverf/index.js:198:20) at null. (/usr/local/lib/node_modules/homebridge-lightwaverf/index.js:287:53) at emitThree (events.js:97:13) at emit (events.js:175:7) at Characteristic.setValue (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Characteristic.js:155:10) at Bridge. (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:710:22) at Array.forEach (native) at Bridge.Accessory._handleSetCharacteristics (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:655:8)

I appreciate it makes reference to a queue length of >10, but the device number that crashes home bridge is definitely 14, at least on my setup.

rooi commented 7 years ago

Hi @Cardo1 This seems an error in node-lightwaverf. I've just push a fix, could you test if this works for you? Just install homebridge-lightwaverf again and it should get the latest version of node-lightwaverf.

Thanks!

Roy

Cardo1 commented 7 years ago

Roy, I've installed the updated version and this seems to be working fine, now. Thanks.

rooi commented 7 years ago

Great!