tslumd.sender
- class tslumd.sender.UmdSender(*args, **kwargs)[source]
Bases:
DispatcherSend UMD Messages
Messages are sent immediately when a change is made to any of the
Tallyobjects intallies. These can be added by using theadd_tally()method.Alternatively, the
set_tally_color()andset_tally_text()methods may be used.- Parameters:
clients – Intitial value for
clientsall_off_on_close – Initial value for
all_off_on_close
Changed in version 0.0.4: The
all_off_on_closeparameter was added- all_off_on_close: bool
If
True, a broadcast message will be sent before shutdown to turn off all tally lights in the system. (default isFalse)Added in version 0.0.4.
- tallies: dict[Tuple[int, int], Tally]
Mapping of
Tallyobjects by theiridNote
This should not be altered directly. Use
add_tally()instead
- property loop: AbstractEventLoop
The
asyncio.BaseEventLoopassociated with the instance
- property broadcast_screen: Screen
A
Screeninstance created usingScreen.broadcast()Added in version 0.0.3.
- async send_scontrol(screen_index: int, data: bytes)[source]
Send an
SCONTROLmessage- Parameters:
Added in version 0.0.2.
- async send_broadcast_scontrol(data: bytes)[source]
Send a
broadcastSCONTROLmessage- Parameters:
data – The data to send in the
scontrolfield
Added in version 0.0.2.
- add_tally(tally_id: Tuple[int, int], **kwargs) Tally[source]
Create a
Tallyobject and add it totalliesif one does not existIf necessary, creates a
Screenusingget_or_create_screen()- Parameters:
tally_id – A tuple of (
screen_index,tally_index)**kwargs – Keyword arguments passed to create the tally instance
- Raises:
KeyError – If the given
tally_idalready exists
Changed in version 0.0.3: Chaned the
tally_indexparameter totally_id
- get_or_create_tally(tally_id: Tuple[int, int]) Tally[source]
If a
Tallyobject matching the given tally id exists, return it. Otherwise, create it usingScreen.get_or_create_tally()This method is similar to
add_tally()and it can be used to avoid exception handling. It does not however take keyword arguments and is only intended for object creation.Added in version 0.0.3.
- get_or_create_screen(index_: int) Screen[source]
Create a
Screenobject and add it toscreensAdded in version 0.0.3.
- set_tally_color(tally_id: Tuple[int, int], tally_type: str | TallyType, color: str | TallyColor)[source]
Set the tally color for the given index and tally type
Uses
Tally.set_color(). See the method documentation for details- Parameters:
tally_id (TallyKey) – A tuple of (
screen_index,tally_index)tally_type (TallyType or str) –
TallyTypeor member name as described inTally.set_color()color (TallyColor or str) –
TallyColoror color name as described inTally.set_color()
Changed in version 0.0.3: Chaned the
tally_indexparameter totally_idChanged in version 0.0.5: Accept string arguments and match behavior of
Tally.set_color()
- set_tally_text(tally_id: Tuple[int, int], text: str)[source]
Set the tally text for the given id
- Parameters:
tally_id – A tuple of (
screen_index,tally_index)text – The
textto set
Changed in version 0.0.3: Chaned the
tally_indexparameter totally_id
- async send_tally_control(tally_id: Tuple[int, int], data: bytes)[source]
Send
controldata for the given screen and tally index- Parameters:
tally_id – A tuple of (
screen_index,tally_index)control – The control data to send
Added in version 0.0.2.
Changed in version 0.0.3: Chaned the
tally_indexparameter totally_id
- async send_broadcast_tally_control(screen_index: int, data: bytes, **kwargs)[source]
Send
controldata asbroadcastto all listening displays- Parameters:
Added in version 0.0.2.
Changed in version 0.0.3: Added the screen_index parameter