Skip to content
forked from jedcn/blync-core

Library for interacting with Embrava's Blynclight Standard

License

Notifications You must be signed in to change notification settings

ndinu/blync-core

 
 

Repository files navigation

blync-core

JavaScript Library for interacting with Embrava's Blynclight Standard.

Usage

Get a reference to the BlyncLight attached to your computer:

const blyncCore = require('blync-core');
const blyncLight = blyncCore.findAllBlyncLights()[0];

The blyncLight reference above has a method named setColor.

This method works with values like #f00 or #ff00cc or with CSS color names like indigo or MediumSeaGreen.

blyncLight.setColor('indigo');

The setColor function returns a promise, and so you can call then() on the result:

// Red for a second, then blue for a second, then off.
blyncLight.setColor('red');
  .then(function() {
    setTimeout(function() {
      blyncLight.setColor('blue');
      setTimeout(function() {
        blyncLight.turnOff();
      }, 1000);
    }, 1000);
  })

The BlyncLight has a built in "blink" capability, and you can provide values of none, slow, or fast when setting a color:

// Flash blue for 5 seconds
blyncLight.setColor({
  color: 'blue',
  blink: 'slow'
});

When you are done, you can turn it off:

blyncLight.turnOff();

Further Reading

Circle CI Travis

An overview of blync-core.

About

Library for interacting with Embrava's Blynclight Standard

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%