peter-murray / node-hue-api

Node.js Library for interacting with the Philips Hue Bridge and Lights
Apache License 2.0
1.19k stars 145 forks source link

created scene id is 'NaN' #45

Closed hansmbakker closed 9 years ago

hansmbakker commented 9 years ago

I'm using node-hue-api 1.0.3 and I have not set a custom scene id prefix.

When calling api.createScene, the resulting id is a NaN, whereas this should be a unique string.

Example result json:

{ lights: [ '4', '5', '6' ], id: 'NaN' }

I think the problem is in

HueApi.prototype._getScenePrefix = function () {
    return this._getConfig().scene_prefix;
};

I think it should be

HueApi.prototype._getScenePrefix = function () {
    return this._getConfig().scenePrefix;
};
peter-murray commented 9 years ago

Thanks, good find, my test coverage was not sufficient, I have now improved this.

Version 1.0.4 has been published to fix this.

hansmbakker commented 9 years ago

thank you for the quick fix!