Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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");
}
}
});
}
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");
}
}
});
}