Skip to content

Latest commit

 

History

History
93 lines (68 loc) · 2.85 KB

README.md

File metadata and controls

93 lines (68 loc) · 2.85 KB

blync-node-ts

An unofficial NodeJS SDK with TypeScript Support for Embrava Blynclight Products.

Getting Started

Minimum requirements & compatibility

To run the SDK you will need NodeJS (14.x) and npm. This library is modeled on the decompiling Blynclight .NET SDK - version 3.0.4;

Install the sdk

This library can be installed via npm:

npm install blync-node-ts

Or installed locally:

git clone https://github.com/xadamxk/blync-node-ts.git
cd ./blync-node-ts
npm install
npm link

cd ../test-project
npm link blync-node-ts

Features

Usage - Examples

const {
    // Classes
    BlyncConnector,
    BlyncLightByte,
    BlyncColor,
    // Enums
    BlyncBlinkSpeedEnum,
    BlyncLightLevelEnum,
    BlyncLightStatusEnum,
} = require('blync-node-ts')

 /* Turn light and sound off on exit */
 ['exit', 'uncaughtException', 'SIGINT', 'SIGTERM', 'SIGQUIT']
  .forEach(signal => process.on(signal, () => {
    device.turnOff();
    process.exit();
  }));

const blyncConnector = new BlyncConnector();
const device = blyncConnector.getDevice(0);

/* Set color (white) - full brightness - no blink */
device.sendCommand(
    new BlyncColor(255, 255, 255),
    new BlyncLightByte(BlyncLightStatusEnum.ON, BlyncLightLevelEnum.FULL, BlyncBlinkSpeedEnum.OFF)
);

More examples can be found in /examples.

Contributing and Reporting Issues

This project can be forked from Github. Please issue pull requests from feature branches and follow conventional commit standards. Submit bug reports or requests as issues - be sure to provide your operating system, Synclight device, and model number.

Acknowledgements

TODO:

  • fix commit hooks
    • sort-package-json on commit
    • lint on commit
  • Find device by name
  • Find device by index
  • BlyncDevice functions
    • Support color enum
  • Add device support for USB30 devices