PyVenv - provide Makefile building a virtual environment (#16)

* provide Make environment to create virtual Python environment

* add magic folder to gitignore

* README, add udev rule

* Makefile - replace "source" with . for POSIC compatibility

Co-authored-by: Felipe Martin Garcia <me@fmartingr.com>

Co-authored-by: Sebastian Mangelsen (sebman) <sebastian.mangelsen@benify.com>
Co-authored-by: Felipe Martin Garcia <me@fmartingr.com>
This commit is contained in:
Sebastian 2021-11-11 19:21:33 +01:00 committed by GitHub
parent f7441a7ff4
commit 858fc0a331
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 51 additions and 0 deletions

1
.gitignore vendored
View File

@ -88,3 +88,4 @@ ENV/
# Rope project settings
.ropeproject
.built/

34
Makefile Normal file
View File

@ -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/

View File

@ -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