busylight
busylight copied to clipboard
[BUG] Luxafor devices generate too many udev rules
Software Versions:
- Operating System: Any
- Python version: Any
- BusyLight version: Latest
General Type of Problem
- [x] Command-line
Describe the Problem
The udev-rules
subcommand generates four different entries for Luxafor products when one would suffice. Luxafor devices share the same vendor and product identifiers and are disambiguated by their USB accessed product_string
attribute. The udev
subsystem can be configured to perform different actions based on the product_string
value, however there isn't any special-case handling required and a single set of rules would cover all four supported Luxafor devices (BT, Flag, Mute, and Orb).
$ busylight udev-rules
...
# Rules for Luxafor Family of Devices: 1
# 1 Luxafor Flag
KERNEL=="hidraw*", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="f372", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="f372", MODE="0666"
# Rules for Luxafor Family of Devices: 1
# 1 Luxafor BT
KERNEL=="hidraw*", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="f372", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="f372", MODE="0666"
# Rules for Luxafor Family of Devices: 1
# 1 Luxafor Mute
KERNEL=="hidraw*", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="f372", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="f372", MODE="0666"
# Rules for Luxafor Family of Devices: 1
# 1 Luxafor Orb
KERNEL=="hidraw*", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="f372", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="f372", MODE="0666"
...
Expected Behavior Only one udev rule generated for supported Luxafor devices:
$ busylight udev-rules
...
# Rules for Luxafor Family of Devices: 1
# 1 Luxafor BT, Flag, Mute, Orb
KERNEL=="hidraw*", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="f372", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="f372", MODE="0666"
...