pyluxafor package

Submodules

pyluxafor.pyluxafor module

class pyluxafor.pyluxafor.LuxaforFlag[source]

Bases: object

DEVICE_PRODUCT_ID = 62322
DEVICE_VENDOR_ID = 1240
LED_ALL = 255
LED_BACK_1 = 4
LED_BACK_2 = 5
LED_BACK_3 = 6
LED_BACK_SIDE = 66
LED_TAB_1 = 1
LED_TAB_2 = 2
LED_TAB_3 = 3
LED_TAB_SIDE = 65
MODE_FADE_COLOUR = 2
MODE_PATTERN = 6
MODE_STATIC_COLOUR = 1
MODE_STROBE = 3
MODE_WAVE = 4
PATTERN_LUXAFOR = 1
PATTERN_POLICE = 5
PATTERN_RAINBOWWAVE = 8
PATTERN_RANDOM1 = 2
PATTERN_RANDOM2 = 3
PATTERN_RANDOM3 = 4
PATTERN_RANDOM4 = 6
PATTERN_RANDOM5 = 7
WAVE_DOUBLE_LARGE = 4
WAVE_DOUBLE_SMALL = 3
WAVE_SINGLE_LARGE = 2
WAVE_SINGLE_SMALL = 1
create_fade_colour_command(led, r, g, b, duration=20)[source]
create_pattern_command(pattern_id, repeat=1)[source]
create_static_colour_command(led, r, g, b)[source]
create_strobe_command(led, r, g, b, duration=20, repeat=2)[source]
create_wave_command(wave_type, r, g, b, duration=20, repeat=1)[source]
do_fade_colour(leds, r, g, b, duration)[source]

Fade a single LED or multiple LEDs from their current colour to a new colour for the supplied duration.

do_pattern(pattern, repeat)[source]

Execute a built in pattern a given number of times.

do_static_colour(leds, r, g, b)[source]

Set a single LED or multiple LEDs immediately to the specified colour.

do_strobe(led, r, g, b, duration, repeat)[source]

Flash the specified LED a specific colour, giving the duration of each flash and the number of times to repeat.

Unfortunately this command does not support multiple specific LEDs.

do_wave(wave_type, r, g, b, duration, repeat)[source]

Animate the flag with a wave pattern of the given type, using the specified colour, duration and number of times to repeat.

find_device()[source]

Attempts to retrieve the Luxafor Flag device using the known Vendor and Product IDs.

get_device()[source]

Retrieve a PyUSB device for the Luxafor Flag.

Will lazy load the device as necessary.

off()[source]

Turn off all LEDs.

setup_device(device)[source]

Performs initialisation on the device.

write(values)[source]

Send values to the device.

Expects the values to be a List of command byte codes. Refer to the individual commands for more information on the specific command codes.

Module contents