[][src]Crate luxafor

Library, and CLI, for Luxafor lights via webhooks or USB.

This has been tested with the USB connected flag as well as the Bluetooth lights.

Examples

The following shows the command line tool setting the color to red.

❯ lux -d 2a0f2c73b72 solid red

The following shows the command line tool setting the color to a blinking green. This example uses the environment variable LUX_DEVICE to save repeating the device identifier on each call.

❯ export LUX_DEVICE=2a0f2c73b72
❯ lux blink green

The following shows the command line tool turning the light off.

❯ lux -vvv -d 2a0f2c73b72 off
 INFO  luxafor > Setting the color of device '2a0f2c73b72e' to 000000
 INFO  luxafor > call successful

The following shows the how to set USB connected lights.

❯ lux -d usb solid red

Features

  • command-line; provides the command line tool lux, it is not on by default for library clients.
  • usb; provides access to USB connected devices.
  • webhook (default); provides access to USB, or Bluetooth, devices via webhooks.

Modules

error

Error handling types.

usb_hid

Implementation of the Device trait for USB connected lights.

webhook

Implementation of the Device trait for webhook connected lights.

Enums

Pattern

A pattern the light can be set to show.

SolidColor

A color that the light can be set to.

Traits

Device

A trait implemented by different access methods to control a light.

DeviceIdentifier

Trait describing a device identifier, basically you just need to be able to to_string() it.