{"id":16930437,"url":"https://github.com/fmartingr/pyluxafor","last_synced_at":"2025-04-11T15:32:10.620Z","repository":{"id":16697101,"uuid":"79268534","full_name":"fmartingr/pyluxafor","owner":"fmartingr","description":"Simple helper library and CLI to interact with luxafor products","archived":false,"fork":false,"pushed_at":"2022-04-01T01:35:35.000Z","size":28,"stargazers_count":12,"open_issues_count":1,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-25T15:35:08.459Z","etag":null,"topics":["cli","led","luxafor","python","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fmartingr.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":"2017-01-17T20:26:07.000Z","updated_at":"2024-03-14T17:45:33.000Z","dependencies_parsed_at":"2022-08-07T08:15:32.077Z","dependency_job_id":null,"html_url":"https://github.com/fmartingr/pyluxafor","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmartingr%2Fpyluxafor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmartingr%2Fpyluxafor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmartingr%2Fpyluxafor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmartingr%2Fpyluxafor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fmartingr","download_url":"https://codeload.github.com/fmartingr/pyluxafor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248431648,"owners_count":21102236,"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":["cli","led","luxafor","python","python3"],"created_at":"2024-10-13T20:41:43.157Z","updated_at":"2025-04-11T15:32:10.359Z","avatar_url":"https://github.com/fmartingr.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pyluxafor\n\nHelper interface and CLI to interact with [luxafor](https://luxafor.com) products.\n\n## Install\n\n```\ngit clone git@github.com:fmartingr/pyluxafor.git\ncd pyluxafor\npython3 setup.py install\n```\n\n## Ensure that USB device gets proper permissions\n\nCreate UDEV rule in /etc/udev/rules.d/60-luxafor.rules with the following content\n```\n# add Luxafor LED flag\nSUBSYSTEMS==\"usb\", ATTR{idVendor}==\"04d8\", ATTR{idProduct}==\"f372\", MODE:=\"0666\"\n```\n\nReload udev configuration files\n\n```shell\nsudo udevadm control --reload \u0026\u0026 sudo udevadm trigger\n```\n\nReinsert the Luxafor LED light.\n\n## Using the CLI\n\nPyluxafor provides the `luxa` command to interact with the USB led in the same way as the library\ndoes, with some helper commands to convert colors between RGB/Hex.\n\n```\n# Converts between hexadecimal to decimal color notations\nluxa hex2dec 00ff00\nluxa dec2hex 255 255 0\n\n# Set a flag with a fixed color\nluxa set --led=all #ff0000\n\n# Fade\nluxa fade --led=all --speed=10 #00ff00\n\n# Strobe\nluxa strobe --led=front --speed=100 --repeat=10 #0000ff\n\n# Wave\nluxa wave --wave 3 --duration=100 --repeat=200 #ff0000\n\n# Pattern\nluxa pattern --repeat=2 2\n\n# Turns off the luxafor\nluxa off\n\n# Using the conversion helpers in one command\nluxa set $(luxa dec2hex 255 0 0)\n```\n\n## Using as a library\n\n``` python\nfrom luxafor import luxafor\n\nlux = luxafor.Luxafor()\n\n# Led types\nluxafor.Leds.ALL\nluxafor.Leds.FRONT\nluxafor.Leds.BACK\nluxafor.Leds.LEDn # Where n is a number from 1 to 6, refer to the class\n\n# Set a basic color\n# From: off, yellow, green, blue, magenta, cyan, red, white\nlux.set_basic_color('green')\n\n# Set a static color\nlux.set_color(\u003cred\u003e, \u003cgreen\u003e, \u003cblue\u003e, \u003cled\u003e)\n\n# Fade to a color\nlux.fade(\u003cred\u003e, \u003cgreen\u003e, \u003cblue\u003e, \u003cled\u003e, \u003cspeed\u003e)\n\n# Strobe\nlux.strobe(\u003cred\u003e, \u003cgreen\u003e, \u003cblue\u003e, \u003cled\u003e, \u003cspeed\u003e, \u003crepeat times\u003e)\n\n# Wave\n# Wave types:\n# 1: Short wave\n# 2: Long wave\n# 3: Overlapping short wave\n# 4: Overlapping long wave\nlux.wave(\u003cred\u003e, \u003cgreen\u003e, \u003cblue\u003e, \u003cled\u003e, \u003cwave type\u003e, \u003cduration\u003e, \u003crepeat times\u003e)\n\n# Enable predefined pattern\n# Patterns from 1 to 8\nlux.pattern(\u003cpattern number\u003e, \u003crepeat\u003e)\n\n# Turn off the luxafor\nlux.turn_off()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffmartingr%2Fpyluxafor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffmartingr%2Fpyluxafor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffmartingr%2Fpyluxafor/lists"}