Control a Luxafor light
Kind: global class
- Luxafor
- instance
- static
- .getApiValue(haystack, needle)
- .findApiReply(buffer) ⇒
String
|Buffer
Initialize a single Luxafor light. Thank you Dave Irvine.
Kind: instance method of Luxafor
Param | Type | Description |
---|---|---|
cb | Number |
callback to execute |
Set one of several preset colors from the API
Kind: instance method of Luxafor
Param | Type | Description |
---|---|---|
char | Number |
number representing one of the preset colors |
cb | function |
callback to execute |
Set a color
Kind: instance method of Luxafor
Param | Type | Description |
---|---|---|
led | Number |
0..6 the light to control |
red | Number |
0..255 red value |
green | Number |
0..255 green value |
blue | Number |
0..255 blue value |
cb | function |
callback to execute |
Instantly set a color then set the color change timer The time param causes the specified time delay to occur on all subsequent calls to color
Kind: instance method of Luxafor
Param | Type | Description |
---|---|---|
led | Number |
0..6 the light to control |
red | Number |
0..255 red value |
green | Number |
0..255 green value |
blue | Number |
0..255 blue value |
time | Number |
0..255 length of fade effect |
cb | function |
callback to execute |
Make the light strobe
Kind: instance method of Luxafor
Param | Type | Description |
---|---|---|
led | Number |
0..6 the light to control |
red | Number |
0..255 red value |
green | Number |
0..255 green value |
blue | Number |
0..255 blue value |
time | Number |
0..255 length of strobe effect |
repeat | Number |
0..255 number of iterations, 0 is infinite |
cb | function |
callback to execute |
Make the light display a wave pattern
Kind: instance method of Luxafor
Param | Type | Description |
---|---|---|
type | Number |
0..5 the type of wave |
red | Number |
0..255 red value |
green | Number |
0..255 green value |
blue | Number |
0..255 blue value |
repeat | Number |
0..255 number of iterations, 0 is infinite |
speed | Number |
0..255 0 is faster |
cb | function |
callback to execute |
Run the light through preprogrammed sequences
Kind: instance method of Luxafor
Param | Type | Description |
---|---|---|
pattern | Number |
0..8 the preset pattern to use |
repeat | Number |
0..255 number of iterations, 0 is infinite |
cb | function |
callback to execute |
Get FW_VERSION, SERIAL_NUMBER_H, SERIAL_NUMBER_L from the device There's no additional information about the meaning of H or L
Kind: instance method of Luxafor
Returns: Promise
- Buffer
Get an API value by key from the API object Case insensitive
Kind: static method of Luxafor
Param | Type | Description |
---|---|---|
haystack | String |
the string name of haystack |
needle | String |
the key to search |
Number | Null |
Search to see if a reply buffer from the device is one we recognize
Kind: static method of Luxafor
Throws:
- Will freak out if the device returns an unrecognized byte
Param | Type | Description |
---|---|---|
buffer | Buffer |
The needle to search for |