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

broadlink-smartbulb

v1.0.1

Published

A promise based Node.js module for Broadlink controllers

Downloads

5

Readme

Node.JS library for Broadlink Smartbulb

A promise based Node.js module created from Python API python-broadlink for controlling Broadlink Smartbulb.

Example use

Setup a new device on your local wireless network:

  1. Put the device into AP Mode
  2. Long press the reset button until the blue LED is blinking quickly.
  3. Long press again until blue LED is blinking slowly.
  4. Manually connect to the WiFi SSID named BroadlinkProv.
  5. Run setup() and provide your ssid, network password (if secured), and set the security mode
  6. Security mode options are (0 = none, 1 = WEP, 2 = WPA1, 3 = WPA2, 4 = WPA1/2)
const broadlink = require('broadlink-smartbulb');

broadlink.setup('myssid', 'mynetworkpass', 3)

Discover available devices on the local network:

const broadlink = require('broadlink-smartbulb');

let devices = await broadlink.discover();

Obtain the authentication key required for further communication:

let device = await devices[0].auth();

Set RGB color:

await device.setRGBMode()
await device.setRed(255)
await device.setGreen(255)
await device.setBlue(0)
await device.setBrightness(100)

Get state:

console.log(await device.getState())

{
  red: 255,
  blue: 0,
  green: 255,
  pwr: 1,
  brightness: 100,
  colortemp: 2700,
  hue: 60,
  saturation: 100,
  transitionduration: 1500,
  maxworktime: 0,
  bulb_colormode: 0,
  bulb_scenes: '["@01686464,0,0,0", "#ffffff,10,0,#000000,190,0,0", "2700+100,0,0,0", "#ff0000,500,2500,#00FF00,500,2500,#0000FF,500,2500,0", "@01686464,100,2400,@01686401,100,2400,0", "@01686464,100,2400,@01686401,100,2400,@005a6464,100,2400,@005a6401,100,2400,0", "@01686464,10,0,@00000000,190,0,0", "@01686464,200,0,@005a6464,200,0,0"]',
  bulb_scene: '',
  bulb_sceneidx: 255
}