chrippa/ds4drv

Same LED colors for specific devices

Opened this issue · 0 comments

Hi, not really a issue, more like a feature request.

My nephew really loves the color green. His controller has to shine green, lol. So, when we play on steam, I managed to set the green color for his controller, and it saves. But when leaving Steam Link and returning to my Retropie, it assigns Blue for Controller 1, Red for Controller 2 and Green for Controller 3 on the order of the connected controllers.

Is there a way to save the devices addresses in a way that specific devices always get the same colors?

I tried altering the code on my own, but no dice, as my Python knowledge is really basic and I haven't found a way to properly debug the code. I tried doing the following on "led.py":

class ActionLED(Action):
"Sets the LED color on the device."

def setup(self, device):
    if (device.device_addr == "90:89:5F:28:E6:3E"):
        device.set_led(255, 0, 0)
    elif(device.device_addr == "40:1B:5F:C9:5F:51"):
        device.set_led(0, 255, 0)
    elif(device.device_addr == "A0:AB:51:73:CA:50"):
        device.set_led(255, 234, 0)
    else:
        device.set_led(*self.controller.options.led)

def load_options(self, options):

    if (self.controller.device.device_addr == "90:89:5F:28:E6:3E"):
        self.controller.device.device_addr.set_led(255, 0, 0)
    elif(self.controller.device.device_addr == "40:1B:5F:C9:5F:51"):
        self.controller.device.device_addr.set_led(0, 255, 0)
    elif(self.controller.device.device_addr == "A0:AB:51:73:CA:50"):
        self.controller.device.device_addr.set_led(255, 234, 0)
    else:
        self.controller.device.set_led(*options.led)

Any help would be appreciated! Thank you!