mdottavio / ya-lifx

:bulb: - Yet Another LIFX JS client
MIT License
8 stars 1 forks source link

:bulb: ya-lifx

REST client for the Lifx's API; each method of ya-lifx return a promise which resolve with the API's response;

Dev dependencies status

Installing

use npm to install the lib on you proyect;

npm install ya-lifx

Usage

You'll need a valid Lifx's token to use the lib; generate it from https://cloud.lifx.com/settings

var lifx = require('ya-lifx');

lifx.init('YOUR_TOKEN');
lifx.listLights()
  .then(function(response){
    console.log(response);
    console.log('API Limits ', lifx.apiLimits());

  })
  .catch(function(err){
    console.log('Error');
    console.log(err.error);
    console.log(err.warnings);
  });

Available methods

The available methods of the lib are:

Errors and Warnings

Please referer to Errors documentation for more information.

Inspired by pifx

License

MIT