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
config (SingleTallyConfig) – The initial value for
config
brightness_scale (float, optional) – The value to set for
brightness_scale
. Default is 1.0
- 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 ofRgb
- 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
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 colorThe 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
to1.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 theconfig
The columns show the individual
TallyType
values('rh_tally', 'txt_tally', 'lh_tally')
- 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()
orMultiTallyConfig.matches()
, depending on which of the two are used for theBaseIO
subclass- Parameters
tally – Either another
SingleTallyConfig
, atslumd.tallyobj.Tally
instance or a TallyKeytally_type – If provided, a
TallyType
member (or members) to match againstreturn_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