How to use the node-hue-api.setLightState 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 / gateway / devices / lights.js View on Github external
function set_light(device_id,state) {
  console.log("set_light",state);
  for (var i = 0; i < device_array.length; i++) {
    if (device_array[i].device_type == "lights") {
      hue = new HueApi(device_array[i].ipaddress,device_array[i].user);
      hue.setLightState(device_id, state, function(err, results) {
        if (err) console.log(err);
      });
      find_lights(device_array[i]);
    }
  }
}
github physiii / open-automation / controllers / gateway.js View on Github external
function set_light(device_id,state) {
  //console.log("set_light",state);
  for (var i = 0; i < device_array.length; i++) {
    if (device_array[i].device_type == "lights") {
  
      hue = new HueApi(device_array[i].ipaddress,device_array[i].user);
      hue.setLightState(device_id, state, function(err, results) {
        if (err) console.log(err);
      });
      //find_lights(device_array[i]);
    }
  }
}