1.0.0 • Published 2 years ago

lifx-ts v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

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
1.0.0

2 years ago