npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ws2801-alexa

v1.0.2

Published

An alexa connector for the WS2801-Pi module.

Downloads

21

Readme

WS2801-alexa

WS2801-alexa is a package that controls led strips via WS2801-pi on Alexa voice commands.

Wiring

The wiring of the Pi is described here.

SinricPro

A SinricPro account is required to use this module. SinricPro is free for up to three devices.

Usage

There are basically two ways to use WS2801-alexa:

Using this repository

  • Clone this repository
  • Edit the config file as described here
  • Run the build script: npm run build
  • Run the start script: npm start

Using the npm module

  • Create a new npm project folder
  • Install this module: npm i ws2801-alexa
import {AlexaDeviceHandler, Config} from './src/index';

const config: Config = {
  appKey: '<your-sinricpro-app-key>',
  secretKey: '<your-sinricpro-secret-key>',
  deviceId: '<your-sinricpro-device-id>',
  ledAmount: 10,
};

const alexaDeviceHandler: AlexaDeviceHandler = new AlexaDeviceHandler(config);

alexaDeviceHandler.start();

Configuration

The config can be specified when initializing the AlexaDeviceHandler. If no config is specified or the repository is used, the defaultConfig is used, which is stored here.

Sinric Pro

Before the configuration can be filled in, a Sinric Pro device must be created.

  1. Open Sinric Pro.
  2. Login
  3. Open the devices view and click on the Add button.
  4. Enter a name (e.g. LedController) and a description.
  5. Select Smart Light Bulb as device type.
  6. Click on the Continue buttons and the Save Button

WS2801-alexa

The config can look like this:

{
  appKey: '<your-sinricpro-app-key>',
  secretKey: '<your-sinricpro-secret-key>',
  deviceId: '<your-sinricpro-device-id>',
  ledAmount: 10,
};
  • appKey Your sinric app key. The app key can be found here.
  • secretKey Your sinric secret key. The secret key can be found here.
  • deviceId The device ID of the Sinric device that is used to trigger the coal heating. The device id can be found here.
  • ledAmount LedAmount is used to specify how many leds are connected to the Pi. This is only necessary if no other ledController is specified in the constructor.

Functions

constructor

Parameters:

  • config

  • ledController

    • optional
    • Type: LedController
    • The led controller that controls the leds of the connected led strip. If no value is specified, WS2801-webserver will create its own LedController with the LedAmount configured in the default config.
      • To avoid rendering problems, there should be only one LedController instance.

start

Starts the AlexaDeviceHandler.

stop

Stops the AlexaDeviceHandler.