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

Get the light types to handle Lux lights #49

Closed gauntface closed 9 years ago

gauntface commented 9 years ago

I'm just starting to play around with this API (thanks a lot for writing this), at the moment getting the lights, I'm not receiving any info on the type of lights, is this something I'm doing wrong?

hueApi.lights()
    .then(function(result) {
      this.log('Lights = ' + JSON.stringify(result));
      cb(null, result);
    }.bind(this))
    .fail(function(err) {
      this.log('getLights error: ', err);
      cb(err);
    }.bind(this))
    .done();

Code looks like this, so is just the example from the readme.

The only reason I'd like this info is that Lux lamps look like they may only like having a brightness state applied to them.

peter-murray commented 9 years ago

Lux does only support a subset of the whole Phillips API, on/off and brightness etc.., basically anything that is color related is not going to work for them, and the Bridge will send you back an error.

When you say you are not getting any info, what do you mean exactly? Are you not getting to that code point, or are you getting undefined or null, etc...

Looking at your code sample, you do realise that you can just use hueApi.lights(cb) to replace your whole example, the library will support promises and callbacks.

If you still have issues, can you please provide me the version number of library that you have installed?

Thanks,

gauntface commented 9 years ago

Sorry - this bug was a total waste of time - my package.json was referring to an older version of node-hue-api. Updating as changed the output.

Thanks for the epic library!!