Package Exports
- deadlights
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (deadlights) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
deadlights
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 deadlightsRequirements
- 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 & get its state
.then(bulbs => bulbs.pop()
.refresh())
.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.