gpio Module

GpioInput Class

class tallypi.inputs.gpio.GpioInput(*args, **kwargs)[source]

Bases: tallypi.baseio.BaseInput

A single tally input using a GPIO pin on the RPi

__init__(config: tallypi.common.SingleTallyConfig, pin: int)[source]

Initialize self. See help(type(self)) for accurate signature.

pin: int

The GPIO input pin number

screen: tslumd.tallyobj.Screen

A tslumd.tallyobj.Screen instance for the input

tally: tslumd.tallyobj.Tally

A tslumd.tallyobj.Tally instance for the input

classmethod get_init_options()Tuple[tallypi.config.Option][source]

Get the config.Option definitions required for this object

async open()[source]

Initalize any necessary device communication

async close()[source]

Close device communication

get_screen(screen_index: int)Optional[tslumd.tallyobj.Screen][source]

Get a Screen object by the given index

If no screen exists, None is returned


Get all available Screen instances for the input

get_tally(tally_key: Tuple[int, int])Optional[tslumd.tallyobj.Tally][source]

Get a Tally object by the given key

If no tally information exists for this input, None is returned


tally_key (tslumd.common.TallyKey) – A tuple of (screen_index, tally_index) formatted as SingleTallyConfig.tally_key

get_all_tallies(screen_index: Optional[int] = None)Iterable[tslumd.tallyobj.Tally][source]

Get all available Tally instances for the input


screen_index (int, optional) – If present, only include tallies within the specified screen