rodtoll / homebridge-isy-js

Homebridge platform plugin for the ISY series of home controllers from Universal Devices.
MIT License
22 stars 27 forks source link

This callback function has already been called by someone else; it can only be called one time #57

Open Valdhor opened 6 years ago

Valdhor commented 6 years ago

In /usr/local/lib/node_modules/homebridge-isy-js/index.js there appears to be a bug with the callback at the end of function:

ISYPlatform.prototype.accessories = function(callback)

I changed the following:

callback(results);

to:

if(callbackCount == 0) { callback(results); callbackCount++; }

As well as adding the following line to the beginning of the function:

var callbackCount = 0;

Which appears to make it work (At least on FreeBSD11)