0.1.5 • Published 7 years ago
lifx.js v0.1.5
lifx.js
Requires a Node.js version equal to or higher than 6.9.0!
A LIFX API for Node.js
Installation
Run npm install lifx.js
in a shell.
Usage & Example
const LIFX = require('lifx.js');
const api = new LIFX.LIFX("your lifx http api token");
api.getLights().then(lights => {
for(let _lt in lights) {
if(!lights.hasOwnProperty(_lt)) continue;
let light = lights[_lt];
light.togglePower();
console.log(light.label);
}
}).catch(res => {
console.error(res);
});
Documentation
We now have documentation!