A simple JS library to control your Luxafor device.
Install @nerdenough/luxafor using either npm or yarn.
npm install --save @nerdenough/luxafor
# or
yarn add @nerdenough/luxafor
Here's a simple example of how you can change the front LEDs to be red.
const luxafor = require('@nerdenough/luxafor')
luxafor.color({ led: luxafor.LUXAFOR_LED_FRONT, red: 255 })
Sets the color for the chosen LEDs with the specified color values. Setting the speed will fade to the new color instead of an instant change.
Activates the strobe effect for the chosen LEDs with the specified color values, speed, and repetitions.
Activates one of 5 wave patterns with the specified color values, speed, and repetitions. Affects all LEDs.
Activates one of the 8 pre-programmed Luxafor patterns. Affects all LEDs.
Constant | Description |
---|---|
LUXAFOR_LED_1 |
Front lower LED |
LUXAFOR_LED_2 |
Front middle LED |
LUXAFOR_LED_3 |
Front upper LED |
LUXAFOR_LED_4 |
Rear lower LED |
LUXAFOR_LED_5 |
Rear middle LED |
LUXAFOR_LED_6 |
Rear upper LED |
LUXAFOR_LED_FRONT |
All front LEDs |
LUXAFOR_LED_BACK |
All rear LEDs |
LUXAFOR_LED_ALL |
All LEDs |
Constant | Description |
---|---|
LUXAFOR_WAVE_1 |
I have no idea wtf this does |
LUXAFOR_WAVE_2 |
Single color (other LEDs turned off), small wave |
LUXAFOR_WAVE_3 |
Single color (other LEDs turned off), large wave |
LUXAFOR_WAVE_4 |
Dual color (other LEDs turned on), small wave |
LUXAFOR_WAVE_5 |
Dual color (other LEDs turned on), large wave |
Constant | Description |
---|---|
LUXAFOR_PATTERN_1 |
Luxafor pattern |
LUXAFOR_PATTERN_2 |
TODO |
LUXAFOR_PATTERN_3 |
TODO |
LUXAFOR_PATTERN_4 |
TODO |
LUXAFOR_PATTERN_5 |
Police pattern |
LUXAFOR_PATTERN_6 |
TODO |
LUXAFOR_PATTERN_7 |
TODO |
LUXAFOR_PATTERN_8 |
Rainbow pattern |