You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the Problem
The udev-rulessubcommand 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"
...
The text was updated successfully, but these errors were encountered:
The class method busylight.lights.hidlight.HIDLight.udev_rules invokes udev_rules for each of its subclasses. While the subclass "tree" is walked, the current subclass has no knowledge of previous invocations of udev_rules. As the current implementation stands, I don't see an easy way to fix this without re-writing and changing the class method substantially.
Each Luxafor light subclass is invoked separately by udev_rules so dedupe'ing entries would require having all the device information collected before the rule strings are generated. This would entail changing the return values of udev_rules from a list of strings to a list of tuples (or similar), dedup'ing the tuples and then generating the formatted udev rule strings. I could bubble that change in the interface up to the busylight.lights.light.Light.udev_rules class method and leave it to the command line invocation to produce the formatted output.
Software Versions:
General Type of Problem
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 accessedproduct_string
attribute. Theudev
subsystem can be configured to perform different actions based on theproduct_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).Expected Behavior
Only one udev rule generated for supported Luxafor devices:
The text was updated successfully, but these errors were encountered: