Skip to content

jonathonball/node-luxafor2

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

91 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Luxafor

Control a Luxafor light

Kind: global class

luxafor.init(cb)

Initialize a single Luxafor light. Thank you Dave Irvine.

Kind: instance method of Luxafor

Param Type Description
cb Number callback to execute

luxafor.simpleColor(char, cb)

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

luxafor.color(led, red, green, blue, cb)

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

luxafor.colorFade(led, red, green, blue, time, cb)

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

luxafor.strobe(led, red, green, blue, time, repeat, cb)

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

luxafor.wave(type, red, green, blue, repeat, speed, cb)

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

luxafor.pattern(pattern, repeat, cb)

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

luxafor.getDeviceInfo() ⇒ Promise

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

Luxafor.getApiValue(haystack, needle)

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

Luxafor.findApiReply(buffer) ⇒ String | Buffer

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

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%