@eschoellhorn/deadlights

0.6.0 • Public • Published

deadlights

Build Status Dependency Status

Interface for Flux (aka "Magic Home") WiFi RGB light bulbs

This wouldn't be possible without the Python flux_led project.

My ultimate goal here is to create a Node-RED flow for Flux WiFi bulb control; see node-red-contrib-fluxwifi.

Installation

$ npm install deadlights

Requirements

  • Node.js, probably 4.x or newer

Usage

API is not yet fully implemented!

API docs forthcoming, but an example:

const {discover} = require('deadlights');

// find all the bulbs on the local network
discover()
  // grab the first one
  .then(bulbs => bulbs.pop())
  .then(bulb => {
    // toggle the bulb on and off
    if (bulb.isOn) {
      return bulb.switchOff();
    } else {
      return bulb.switchOn();
    }
  })
  .then(bulb => {
    // close the connection to the bulb;
    // without this, the connection (and script) would stay open indefinitely
    return bulb.forget();
  });

License

©️ 2017 Christopher Hiller. Licensed MIT.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.6.0
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.6.0
    0

Package Sidebar

Install

npm i @eschoellhorn/deadlights

Weekly Downloads

0

Version

0.6.0

License

MIT

Unpacked Size

91.1 kB

Total Files

18

Last publish

Collaborators

  • eschoellhorn