/node-yeelight-blue

A Node.js lib for the yeelight blue and yeelight blue lightstrips.

Primary LanguageJavaScriptMIT LicenseMIT

node-yeelight-blue

Analytics

A Node.js lib for the yeelight blue and yeelight blue lightstrips.

Yeelight Blue Message Interface

Install

npm install yeelight-blue

Usage

var YeelightBlue = require('yeelight-blue');

Discover

YeelightBlue.discover(callback(yeelightBlue));

Connect and Setup

// connects + discovers services and characteristics
yeelightBlue.connectAndSetUp(callback(error));

Disconnect

yeelightBlue.disconnect(callback);

Turn off/on__

yeelightBlue.turnOff(callback(error));

yeelightBlue.turnOn(callback(error));

Set Color and Brightness

var red        = 255; // 0 - 255
var green      = 255; // 0 - 255
var blue       = 255; // 0 - 255
var brightness = 100; // 0 - 100

yeelightBlue.setColorAndBrightness(callback(error));

Set Gradual Mode

Enables/disables gradual fading when setting colors and brightness

var on = true; // true (default) | false

yeelightBlue.setGradualMode(on, callback(error));

Events

Disconnect

yeelightBlue.on('disconnect', callback);