tslumd.common
- class tslumd.common.TallyColor(*values)[source]
Bases:
IntFlagColor enum for tally indicators
Since this is an
IntFlag, its members can be combined using bitwise operators, makingAMBERa combination ofREDandGREENThis allows merging one color with another
>>> from tslumd import TallyColor >>> TallyColor.RED <TallyColor.RED: 1> >>> TallyColor.GREEN <TallyColor.GREEN: 2> >>> TallyColor.AMBER <TallyColor.AMBER: 3> >>> TallyColor.RED | TallyColor.GREEN <TallyColor.AMBER: 3>
Changed in version 0.0.4: Bitwise operators
- OFF = 0
Off
- RED = 1
Red
- GREEN = 2
Green
- AMBER = 3
Amber
- static from_str(s: str) TallyColor[source]
Return the member matching the given name (case-insensitive)
>>> TallyColor.from_str('RED') <TallyColor.RED: 1> >>> TallyColor.from_str('green') <TallyColor.GREEN: 2> >>> TallyColor.from_str('Amber') <TallyColor.AMBER: 3>
Added in version 0.0.5.
- class tslumd.common.TallyType(*values)[source]
Bases:
IntFlagEnum for the three tally display types in the UMD protocol
Since this is an
IntFlag, its members can be combined using bitwise operators. The members can then be iterated over to retrieve the individual “concrete” values ofrh_tally,txt_tallyandlh_tally>>> from tslumd import TallyType >>> list(TallyType.rh_tally) [<TallyType.rh_tally: 1>] >>> list(TallyType.rh_tally | TallyType.txt_tally) [<TallyType.rh_tally: 1>, <TallyType.txt_tally: 2>] >>> list(TallyType.all_tally) [<TallyType.rh_tally: 1>, <TallyType.txt_tally: 2>, <TallyType.lh_tally: 4>]
Changed in version 0.0.4: Added support for bitwise operators and member iteration
- no_tally = 0
No-op
- rh_tally = 1
- txt_tally = 2
- lh_tally = 4
- all_tally = 7
Combination of all tally types
Added in version 0.0.4.
- property is_iterable: bool
Returns
Trueif this is a combination of multiple members(meaning it must be iterated over)
Added in version 0.0.5.
- classmethod all() Iterator[TallyType][source]
Iterate over all members, excluding
no_tallyandall_tallyAdded in version 0.0.4.
- static from_str(s: str) TallyType[source]
Create an instance from a string of member name(s)
The string can be a single member or multiple member names separated by a “|”. For convenience, the names may be shortened by omitting the
"_tally"portion from the end (“rh” == “rh_tally”, etc)>>> TallyType.from_str('rh_tally') <TallyType.rh_tally: 1> >>> TallyType.from_str('rh|txt_tally') <TallyType.rh_tally|txt_tally: 3> >>> TallyType.from_str('rh|txt|lh') <TallyType.all_tally: 7> >>> TallyType.from_str('all') <TallyType.all_tally: 7>
Added in version 0.0.5.
- to_str() str[source]
Create a string representation suitable for use in
from_str()>>> tt = TallyType.rh_tally >>> tt.to_str() 'rh_tally' >>> tt |= TallyType.txt_tally >>> tt.to_str() 'rh_tally|txt_tally' >>> tt |= TallyType.lh_tally >>> tt.to_str() 'all_tally'
Added in version 0.0.5.
- class tslumd.common.TallyState(*values)[source]
Bases:
IntFlag- OFF = 0
Off
- PREVIEW = 1
Preview
- PROGRAM = 2
Program
- class tslumd.common.MessageType(*values)[source]
Bases:
EnumMessage type
Added in version 0.0.2.
- display = 1
A message containing tally display information
- control = 2
A message containing control data
- tslumd.common.TallyKey
A tuple of (
screen_index,tally_index) to uniquely identify a singleTallywithin itsScreen
- class tslumd.common.DisplayTallyCommonDict[source]
Bases:
TypedDictCommon fields between
DisplayandTallyobjectsAdded in version 0.0.8.
- rh_tally: TallyColor
Color of the right-hand tally indicator
- txt_tally: TallyColor
Color of the text tally indicator
- lh_tally: TallyColor
Color of the left-hand tally indicator