missionpinball/pyprocgame — pull request #1 by koenheltzel (2014-07-10 14:04:07+00:00)
Title: Fix for single and duo color LEDs support.

Hey Brian,

Ran into a bug when using single or duo color LEDs:
Example:
blink = []
blink.append({"color": "ff", "time": 400, 'fade': True})
blink.append({"color": "00", "time": 400, 'fade': True})
self.game.LEDs.run_script(lamp.name, blink)

This is a blinking script for a single color LED.
Result: Nothing happens
Why: the color "ff" gets zfill(6)-ed to "0000ff" and then converted to a list: [0, 0, 255]. Then the first color in that list is used, so always 0.

This pull request has a proposed simple fix that will slice the color list to use the last X values, where X is the number of LED outputs for that LED.

Koen