lifx-ts
v1.0.0
Published
TypeScript module for controlling LIFX smart bulbs
Downloads
2
Readme
lifx-ts
Communicates with LIFX smart bulbs over the local network.
- Robust TypeScript implementation
- zero external dependencies
- just
npm install lifx-ts
, even in a package without TypeScript
Discovery
import { LifxClient, LifxDevice } from 'lifx-ts'
async function discovery() {
const client = new LifxClient()
await client.discover()
client.onConnect(async (device) => {
console.log('IP: ' + device.getIP())
console.log('MAC: ' + device.getMacAddress())
})
}
discovery()
Device
device.turnOn()
Turn on the device.
device.turnOff()
Turn off the device.
device.setColor(color [, duration])
Set the color of a light in HSBK.
device.setRGB(r, g, b [, a])
Set the RGB or RGBA color of a light.
Roadmap
- [ ] write README and documentation
- [ ] commenting
- [ ] jest testing
- [ ] support more LIFX products
Contributing
To make changes to the module, you will need typescript
.
cd lifx-ts
npm install -g typescript
tsc --watch