gpio Module¶
LED outputs using the GPIO interface of the RPi
LED Classes¶
-
class
tallypi.outputs.gpio.LED(*args, **kwargs)[source]¶ Bases:
tallypi.outputs.gpio.SingleLEDA single color, non-dimmed LED
- Parameters
config (SingleTallyConfig) – The initial value for
configpin (int) – The GPIO pin number for the LED
active_high (bool, optional) – Set to
True(the default) for common cathode LEDs,Falsefor common anode LEDsbrightness_scale (float, optional) – The value to set for
brightness_scale. Default is 1.0
-
set_led(color: tslumd.common.TallyColor, brightness: float)[source]¶ Set the LED values from the given color and brightness
-
class
tallypi.outputs.gpio.PWMLED(*args, **kwargs)[source]¶ Bases:
tallypi.outputs.gpio.SingleLEDA single color, dimmable (PWM) LED
- Parameters
config (SingleTallyConfig) – The initial value for
configpin (int) – The GPIO pin number for the LED
active_high (bool, optional) – Set to
True(the default) for common cathode LEDs,Falsefor common anode LEDsbrightness_scale (float, optional) – The value to set for
brightness_scale. Default is 1.0
-
set_led(color: tslumd.common.TallyColor, brightness: float)[source]¶ Set the LED values from the given color and brightness
-
class
tallypi.outputs.gpio.RGBLED(*args, **kwargs)[source]¶ Bases:
tallypi.outputs.gpio.BaseLEDA full color RGB LED using PWM dimming
- Parameters
config (SingleTallyConfig) – The initial value for
configpins – Initial value for
pinsactive_high (bool, optional) – Set to
True(the default) for common cathode LEDs,Falsefor common anode LEDsbrightness_scale (float, optional) – The value to set for
brightness_scale. Default is 1.0
-
classmethod
get_init_options() → Tuple[tallypi.config.Option][source]¶ Get the
config.Optiondefinitions required for this object
-
set_led(color: tslumd.common.TallyColor, brightness: float)[source]¶ Set the LED values from the given color and brightness
Base Classes¶
-
class
tallypi.outputs.gpio.BaseLED(*args, **kwargs)[source]¶ Bases:
tallypi.common.BaseOutputBase class for GPIO LEDs
- Parameters
config (SingleTallyConfig) – The initial value for
configactive_high (bool, optional) – Set to
True(the default) for common cathode LEDs,Falsefor common anode LEDsbrightness_scale (float, optional) – The value to set for
brightness_scale. Default is 1.0
-
brightness_scale: float¶ A multiplier (from 0.0 to 1.0) used to limit the maximum brightness (for PWM LEDs). A value of 1.0 produces the full range while 0.5 scales to half brightness.
-
classmethod
get_init_options() → Tuple[tallypi.config.Option][source]¶ Get the
config.Optiondefinitions required for this object
-
set_led(color: tslumd.common.TallyColor, brightness: float)[source]¶ Set the LED values from the given color and brightness
-
async
on_receiver_tally_change(tally: tslumd.tallyobj.Tally, *args, **kwargs)[source]¶ Callback for tally updates from
tslumd.tallyobj.Tally
-
class
tallypi.outputs.gpio.SingleLED(*args, **kwargs)[source]¶ Bases:
tallypi.outputs.gpio.BaseLEDBase class for LEDs that use a single GPIO pin
- Parameters
config (SingleTallyConfig) – The initial value for
configpin (int) – The GPIO pin number for the LED
active_high (bool, optional) – Set to
True(the default) for common cathode LEDs,Falsefor common anode LEDsbrightness_scale (float, optional) – The value to set for
brightness_scale. Default is 1.0
-
classmethod
get_init_options() → Tuple[tallypi.config.Option][source]¶ Get the
config.Optiondefinitions required for this object