rgbmatrix5x5 Module

An RGB LED display of 5x5 pixels made by pimoroni

Currently uses the library maintained by the manufacturer for device communication

Base Class

class tallypi.outputs.rgbmatrix5x5.Base(*args, **kwargs)[source]

Bases: tallypi.baseio.BaseOutput

Base class for RGBMatrix5x5 displays

Parameters
color_map: ClassVar[Dict[tslumd.common.TallyColor, Tuple[int, int, int]]] = {<TallyColor.OFF: 0>: (0, 0, 0), <TallyColor.RED: 1>: (255, 0, 0), <TallyColor.GREEN: 2>: (0, 255, 0), <TallyColor.AMBER: 3>: (255, 191, 0)}

Mapping of tslumd.common.TallyColor to tuples of Rgb

device: rgbmatrix5x5.RGBMatrix5x5

The rgbmatrix5x5.RGBMatrix5x5 instance

brightness_scale: float

A multiplier (from 0.0 to 1.0) used to limit the maximum brightness. 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.Option definitions required for this object

async open()[source]

Create the device instance and initialize

async close()[source]

Close the device

Indicator Class

class tallypi.outputs.rgbmatrix5x5.Indicator(*args, **kwargs)[source]

Bases: tallypi.outputs.rgbmatrix5x5.Base

Show a solid color for a single Tally

async set_color(color: tslumd.common.TallyColor)[source]

Set all pixels of the device to the given color

The rgb values are retrieved from the color_map

Parameters

color – The TallyColor

async set_brightness(brightness: float)[source]

Set the brightness of the device

Parameters

brightness – The brightness value from 0.0 to 1.0

async on_receiver_tally_change(tally: tslumd.tallyobj.Tally, props_changed: Set[str], **kwargs)[source]

Callback for tally updates from tslumd.tallyobj.Tally

Matrix Class

class tallypi.outputs.rgbmatrix5x5.Matrix(*args, **kwargs)[source]

Bases: tallypi.outputs.rgbmatrix5x5.Base

Show the status of up to 5 tallies in a matrix

The tallies are shown in 5 rows beginning with the tally_index of the config

The columns show the individual TallyType values ('rh_tally', 'txt_tally', 'lh_tally')

async open()[source]

Create the device instance and initialize

async close()[source]

Close the device

tally_matches(tally: tslumd.tallyobj.Tally, tally_type: Optional[tslumd.common.TallyType] = <TallyType.all_tally: 7>, return_matched: Optional[bool] = False)Union[bool, tallypi.common.SingleTallyConfig][source]

Determine whether the given tally matches the config

Uses either SingleTallyConfig.matches() or MultiTallyConfig.matches(), depending on which of the two are used for the BaseIO subclass

Parameters
  • tally – Either another SingleTallyConfig, a tslumd.tallyobj.Tally instance or a TallyKey

  • tally_type – If provided, a TallyType member (or members) to match against

  • return_matched – If False (the default), only return a boolean result, otherwise return the matched SingleTallyConfig if one was found.

async on_receiver_tally_change(tally: tslumd.tallyobj.Tally, props_changed: Set[str], **kwargs)[source]

Callback for tally updates from tslumd.tallyobj.Tally