{"id":16599869,"url":"https://github.com/vmitchell85/luxafor-python","last_synced_at":"2025-03-21T13:32:35.586Z","repository":{"id":48560602,"uuid":"48720062","full_name":"vmitchell85/luxafor-python","owner":"vmitchell85","description":"Python Script Interface For Luxafor","archived":false,"fork":false,"pushed_at":"2021-07-20T12:07:41.000Z","size":152,"stargazers_count":56,"open_issues_count":1,"forks_count":23,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-18T01:51:28.123Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vmitchell85.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-12-29T01:12:35.000Z","updated_at":"2025-02-21T08:06:30.000Z","dependencies_parsed_at":"2022-08-27T21:22:46.398Z","dependency_job_id":null,"html_url":"https://github.com/vmitchell85/luxafor-python","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmitchell85%2Fluxafor-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmitchell85%2Fluxafor-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmitchell85%2Fluxafor-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmitchell85%2Fluxafor-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vmitchell85","download_url":"https://codeload.github.com/vmitchell85/luxafor-python/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244806180,"owners_count":20513396,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-12T00:12:50.453Z","updated_at":"2025-03-21T13:32:35.225Z","avatar_url":"https://github.com/vmitchell85.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Luxafor Python Script\n\nScript written to modify the [Luxafor](http://www.luxafor.com) USB LED indicator via command line using python.\n\nAny and all improvements welcome and appreciated.\n\nCredit to gist by [dave-irvine](https://gist.github.com/dave-irvine/dbec2584e7508cbfc79e) for pyusb code.\n\n## Requirements\n\u003c!-- Thank you dave-irvine for pioneering the USB connection --\u003e\n\u003c!-- Thank YOU vmitchell85 for this beautiful little tool --\u003e\n\n### Linux\n\n1. Luxafor LED Indicator\n3. Python 2.7+\n4. [PyUSB](https://github.com/pyusb/pyusb) (installable via pip)\n\n### Windows\n\n1. Luxafor LED Indicator\n2. [Luxafor Software](http://luxafor.com/download)\n3. Python 2.7+\n4. [PyWinUSB](https://pypi.python.org/pypi/pywinusb/) (installable via pip)\n\n## Confirmed Working Operating Systems\n- Windows 10\n- Ubuntu 15.10/17.10/18.10/20.04\n\n## Known/Possible Issues\n\n### Linux\n- Sometimes first run doesn't work, have to run command a second time\n\n#### Avoid Sudo Prompt\nBy default python will not let use usb libs and you will need to run command with `sudo` everytime. To prevent this you will need to do the following:\n\n1: Create a file, `/lib/udev/rules.d/50-luxafor.rules` with the following contents:\n\n```\n# Allow Luxafor USB control\nACTION==\"add\", SUBSYSTEMS==\"usb\", ATTRS{idVendor}==\"04d8\", ATTRS{idProduct}==\"f372\", MODE=\"660\", GROUP=\"plugdev\"\n```\n\n2: Reload the `udevadm` using the following commands:  \n`sudo udevadm control --reload`  \n`sudo udevadm trigger`\n\n3: Unplug and reinsert your Luxafor device\n\n### Windows\n- Seems the Luxafor app has to be at least running in the tray for commands to persist\n- Opening the Luxafor app switches the color to Green/Red (depeding on last used?)\n- Seems that it doesn't always return to the exact same state it was in before a strobe or pattern is ran\n\n## Parameters\n\n-d = Device - 1-n for USB device. 0 for all devices (default)  \n-l = LED - 1-6 for specific LED, 65 for front, 66 for back, 0 for all, 255 for all one color  \n-r = RED value (0-255)  \n-g = GREEN value (0-255)  \n-b = BLUE value (0-255)  \n-s = Speed value - Determines speed of strobe or fade (0-255)  \n-t = Repeat value - Determines the frequency of strobe or wave (0-255)  \n-w = Wave value - 5 Different Patterns available (1-5)  \n-p = Built In Patterns - 8 built in patterns\n-x = Hex color value - (\"#RRGGBB\")\n\n### Bluetooth Model\n\n`-l` LED parameters work differently for the Bluetooth Flag:\n\n   - `-l 1` = Left LEDs (dongle + flag)\n   - `-l 2` = Right LEDs (dongle + flag)\n   - `-l 3` = Left LED (dongle only)\n   - `-l 4` = Right LED (dongle only)\n   - `-l 0` and `-l 255` work the same way\n   - `-l 65` and `-l 66` are not compatible\n\n## Actions\n\n### Color\n\nSet the specified LED to the specified color\n\n    luxafor-linux.py color -l 255 -r 255 -g 0 -b 0\n    \n#### Multiple Luxafor Devices\nTested with a Luxafor Flag + Luxafor Bluetooth on the same system. _Non-solid color commmands not tested._\n\n    # First USB device to color red:\n    luxafor-linux.py -d 1 color -l 255 -r 255 -g 0 -b 0\n    \n    # Second USB device to color blue:\n    luxafor-linux.py -d 2 color -l 255 -r 0 -g 0 -b 255\n    \n    # All USB devices to color green:\n    luxafor-linux.py color -l 255 -r 0 -g 255 -b 0\n    # or with explicit parameter:\n    luxafor-linux.py color -d 0 -l 255 -r 0 -g 255 -b 0\n\n#### Hex Color (Linux)\n\t\n    luxafor-linux.py color -x \"#F22613\"\n\n### Fade\n\n    luxafor-linux.py fade -l 255 -r 0 -g 255 -b 0\n\n### Strobe\n\n    luxafor-linux.py strobe -l 255 -r 0 -g 0 -b 255 -s 20 -t 5\n\n### Wave\n\n    luxafor-linux.py wave -w 4 -r 0 -g 0 -b 255 -s 20 -t 3 \n\n### Pattern\n\n    luxafor-linux.py pattern -p 2 -r 3\n\n## Raw Values\n\n### Solid Color\nRaw data array posisitions as follows:\n\n0. Always 0\n1. 1\n2. 1-6 for specific LED, 65 for front, 66 for back, 0 for all, 255 for all one color\n3. RED Value 0-255\n4. GREEN Value 0-255\n5. BLUE Value 0-255\n6. N/A\n7. N/A\n8. N/A\n\n### Fade Color\nRaw data array posisitions as follows:\n\n0. Always 0\n1. 2\n2. 1-6 for specific LED, 65 for front, 66 for back, 0 for all, 255 for all one color\n3. RED Value 0-255\n4. GREEN Value 0-255\n5. BLUE Value 0-255\n6. Changing Time (Duration)\n7. N/A\n8. N/A\n\n### Strobe Color\nRaw data array posisitions as follows:\n\n0. Always 0\n1. 3\n2. 1-6 for specific LED, 65 for front, 66 for back, 0 for all, 255 for all one color\n3. RED Value 0-255\n4. GREEN Value 0-255\n5. BLUE Value 0-255\n6. Speed (30-40 is a fairly calm value)\n7. N/A\n8. N/A\n\n### Wave Color\n\n0. Always 0\n1. 4\n2. Wave Type\n3. RED Value 0-255\n4. GREEN Value 0-255\n5. BLUE Value 0-255\n6. N/A\n7. Repeat (0-255)\n8. Speed (10 is a fairly good value)\n\n### Built In Patterns\n\n0. Always 0\n1. 6\n2. Pattern Number (1-8)\n3. Repeat (0-255)\n4. N/A\n5. N/A\n6. N/A\n7. N/A\n8. N/A\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvmitchell85%2Fluxafor-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvmitchell85%2Fluxafor-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvmitchell85%2Fluxafor-python/lists"}