How to use the node-hue-api.createUser 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 create_user(device) {
  hue = new HueApi();
  hue.createUser(device.ipaddress, function(err, user) {
    if (err) console.log(err);
    for (var i = 0; i < device_array.length; i++) {
      if (device_array[i].id == device.id) {
        device_array[i].user = user;
	device_array[i].device_type = "lights";
	device_array[i].local_ip = local_ip;
 	//device_array[i].token = token;
  	//device_array[i].mac = mac;
	//store_device(device_array[i]);
	find_lights(device_array[i]);
        console.log("created user",device_array[i]);
     }
   }
  });
}
github physiii / open-automation / gateway / devices / lights.js View on Github external
function create_user(device) {
  hue = new HueApi();
  hue.createUser(device.ipaddress, function(err, user) {
    if (err) console.log(err);
    for (var i = 0; i < device_array.length; i++) {
      if (device_array[i].id == device.id) {
        device_array[i].user = user;
	device_array[i].device_type = "lights";
	device_array[i].local_ip = utils.local_ip;
 	//device_array[i].token = token;
  	//device_array[i].mac = mac;
	//database.store_device(device_array[i]);
	find_lights(device_array[i]);
        console.log("created user",device_array[i]);
     }
   }
  });
}