Go to file
Felipe Martin 6c3c8ae24b
Updated README with CLI/Install information
2017-05-03 16:44:37 +02:00
luxafor Added CLI error output when flag is not found 2017-05-03 16:27:40 +02:00
.gitignore First work on the cli 2017-01-30 17:15:02 +01:00
LICENSE Initial commit 2017-01-17 21:26:08 +01:00
README.md Updated README with CLI/Install information 2017-05-03 16:44:37 +02:00
examples.ipynb Added an ipython notebook with examples 2017-01-22 20:35:10 +01:00
pylintrc Added pylintrc 2017-01-18 08:46:56 +01:00
requirements.txt Added requirements file 2017-04-03 21:06:21 +02:00

README.md

pyluxafor

Helper interface and CLI to interact with luxafor products.

Install

pip3 install pyluxafor

or

git clone git@github.com:fmartingr/pyluxafor.git
cd pyluxafor
python3 setup.py install

Using the CLI

Pyluxafor provides the luxa command to interact with the USB led in the same way as the library does, with some helper commands to convert colors between RGB/Hex.

# Converts between hexadecimal to decimal color notations
luxa hex2dec 00ff00
luxa dec2hex 255 255 0

# Set a flag with a fixed color
luxa set --led=all #ff0000

# Fade
luxa fade --led=all --speed=10 #00ff00

# Strobe
luxa strobe --led=front --speed=100 --repeat=10 #0000ff

# Wave
luxa wave --wave 3 --duration=100 --repeat=200 #ff0000

# Pattern
luxa pattern --repeat=2 2

# Turns off the luxafor
luxa off

# Using the conversion helpers in one command
luxa set $(luxa dec2hex 255 0 0)

Using as a library

from luxafor import luxafor

lux = luxafor.Luxafor()

# Led types
luxafor.Leds.ALL
luxafor.Leds.FRONT
luxafor.Leds.BACK
luxafor.Leds.LEDn # Where n is a number from 1 to 6, refer to the class

# Set a basic color
# From: off, yellow, green, blue, magenta, cyan, red, white
lux.set_basic_color('green')

# Set a static color
lux.set_color(<red>, <green>, <blue>, <led>)

# Fade to a color
lux.fade(<red>, <green>, <blue>, <led>, <speed>)

# Strobe
lux.strobe(<red>, <green>, <blue>, <led>, <speed>, <repeat times>)

# Wave
# Wave types:
# 1: Short wave
# 2: Long wave
# 3: Overlapping short wave
# 4: Overlapping long wave
lux.wave(<red>, <green>, <blue>, <led>, <wave type>, <duration>, <repeat times>)

# Enable predefined pattern
# Patterns from 1 to 8
lux.pattern(<pattern number>, <repeat>)

# Turn off the luxafor
lux.turn_off()