How to use the node-hue-api.lights function in node-hue-api

To help you get started, we’ve selected a few node-hue-api examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github physiii / open-automation / controllers / gateway.js View on Github external
function find_lights(device) {
  hue = new HueApi(device.ipaddress,device.user);
  hue.lights(function(err, lights) {
    if (err) console.log(err);
    for (var i = 0; i < device_array.length; i++) {
      if (device_array[i].id == device.id) {
	device_array[i].lights = lights.lights;
        store_device(device_array[i]);
        console.log("storing lights");
      }
   }
  });
}
github physiii / open-automation / gateway / devices / lights.js View on Github external
function find_lights(device) {
  hue = new HueApi(device.ipaddress,device.user);
  hue.lights(function(err, lights) {
    if (err) console.log(err);
    for (var i = 0; i < device_array.length; i++) {
      if (device_array[i].id == device.id) { 
        if (!lights) return console.log("find_lights | ",lights); 
	device_array[i].lights = lights.lights;
        database.store_device(device_array[i]);
        console.log("storing lights");
      }
   }
  });
}