https://github.com/boneskull/deadlights
Interface for Flux (aka "Magic Home") WiFi RGB light bulbs
https://github.com/boneskull/deadlights
bulb flux flux-lighting home-automation iot magichome rgb smart-home wifi
Last synced: 11 months ago
JSON representation
Interface for Flux (aka "Magic Home") WiFi RGB light bulbs
- Host: GitHub
- URL: https://github.com/boneskull/deadlights
- Owner: boneskull
- License: mit
- Archived: true
- Created: 2016-12-28T09:58:05.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2018-04-19T18:19:29.000Z (almost 8 years ago)
- Last Synced: 2025-03-17T22:42:05.343Z (11 months ago)
- Topics: bulb, flux, flux-lighting, home-automation, iot, magichome, rgb, smart-home, wifi
- Language: JavaScript
- Homepage:
- Size: 128 KB
- Stars: 3
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# deadlights
[](https://travis-ci.org/boneskull/deadlights) [](https://dependencyci.com/github/boneskull/deadlights)
> Interface for [Flux](https://www.fluxsmartlighting.com) (aka "Magic Home") WiFi RGB light bulbs
This wouldn't be possible without the Python [flux_led](https://github.com/beville/flux_led) project.
My ultimate goal here is to create a Node-RED flow for Flux WiFi bulb control; see [node-red-contrib-fluxwifi](https://github.com/node-red-contrib-fluxwifi).
## Installation
```bash
$ npm install deadlights
```
## Requirements
- Node.js, probably 4.x or newer
## Usage
**API is not yet fully implemented!**
API docs forthcoming, but an example:
```js
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
:copyright: 2017 [Christopher Hiller](https://github.com/boneskull). Licensed MIT.