TypeScript library for controlling BlinkStick

Hey.

I forked main Node.js library, because it doesn’t support any new Node version.

Basic functionalities should support all available BlinkStick devices, as these were included in original one.

Install with npm install @ginden/blinkstick-v2

Basic usage:

import { BlinkStick, findFirstAsync, AnimationBuilder } from '@ginden/blinkstick-v2';

// Finds first blinkstick
const blinkstick = findFirst('BlinkStick Nano');
 // Flashes first light in red (retaining original API)
await blinkstick.pulse('red');
// Sets all lights to green
await blinkstick.leds().setColor('green'); 
 // Sets second LED to blue
awat blinkstick.led(1).setColor('blue');

// Run long animation
await blinkstick.animation.runNew(
   AnimationBuilder.startWithBlack(100)
    .morphToColor('red', 250)
   .wait(250)
   .morphToColor('orange', 500)
   .wait(250)
   .morphToColor('yellow', 250)
   .wait(250)
   .morphToColor('green', 250)
   .wait(250)
   .morphToColor('blue', 250)
   .wait(250)
   .repeat(5)
   .build()
);

Arbitrary complicated animations are allowed too, including independently animating LEDs.

Further development is expected, as I’m dogfooding it as notification light for Home Assistant.

I’m also looking for people who would like to contribute to the project, especially for devices that I don’t own.