Git Product home page Git Product logo

blync-node-ts's Introduction

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

blync-node-ts's People

Contributors

xadamxk avatar

Stargazers

 avatar

Watchers

 avatar

blync-node-ts's Issues

BlyncConnector Additions

More device methods:

Change getDevice(index) to getDeviceByIndex(index)
Add getDeviceByProduct(BlyncLightProductsEnum)

Nameplate functions

Blync Nameplate allows you to set text to the LCD.
Support functions if device is nameplate:

  • Clear text - include in turnOff (Decompiled BlynclightController.cs > ResetNameDisplay)
  • Set text (Decompiled BlynclightController.cs > DisplayStringOnNameDisplayDevice)
  • Turn on all pixels (Decompiled BlynclightController.cs > TurnOnAllPixelsOnNameDisplay)

Device Functions

Match all functions at a minimum

  • fadeToRGB
  • setRGB
  • loop(arrayOfConfigurations, interval)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.