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

Missleading error Message #44

Closed neophob closed 9 years ago

neophob commented 9 years ago

I created a LightState for a single lamp using an invalid id (for example 0 instead of 1). The error message is a bit missleading, here's the stack trace:

   "error":"Cannot call method 'hasRGB' of undefined",
   "stack":"TypeError: Cannot call method 'hasRGB' of undefined\n    at HueApi._getLightStateOptions (
   /a-project/node_modules/node-hue-api/hue-api/index.js:996:15)\n    at HueApi.setLightState (
   /a-project/node_modules/node-hue-api/hue-api/index.js:322:24)\n    at Object.exports.lampDim (