diff --git a/.gitignore b/.gitignore index e873c49..20f29c7 100644 --- a/.gitignore +++ b/.gitignore @@ -88,3 +88,4 @@ ENV/ # Rope project settings .ropeproject +.built/ diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..60d7c3c --- /dev/null +++ b/Makefile @@ -0,0 +1,34 @@ +all: test + +venv: .built/venv + +.built/venv: .built/ + ( \ + python3 -m venv venv ;\ + source venv/bin/activate ;\ + pip install --upgrade pip ;\ + pip install --upgrade -r requirements.txt ;\ + touch $@ ;\ + ) + +test: venv + ( \ + . venv/bin/activate ;\ + python3 setup.py install ;\ + luxa off ;\ + sleep 1 ;\ + luxa set --led=all ff0000 ;\ + sleep 1 ;\ + luxa set --led=all 00ff00 ;\ + sleep 1 ;\ + luxa set --led=all 0000ff ;\ + sleep 1 ;\ + luxa off ;\ + ) + +.built/: + @mkdir -p $@ + +clean: + rm -rf venv/ + rm -rf .built/ diff --git a/README.md b/README.md index 3b7c482..416160b 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,22 @@ cd pyluxafor python3 setup.py install ``` +## Ensure that USB device gets proper permissions + +Create UDEV rule in /etc/udev/rules.d/60-luxafor.rules with the following content +``` +# add Luxafor LED flag +SUBSYSTEMS=="usb", ATTR{idVendor}=="04d8", ATTR{idProduct}=="f372", MODE:="0666" +``` + +Reload udev configuration files + +```shell +sudo udevadm control --reload && sudo udevadm trigger +``` + +Reinsert the Luxafor LED light. + ## Using the CLI Pyluxafor provides the `luxa` command to interact with the USB led in the same way as the library