tslumd.sender

tslumd.sender.Client

A network client as a tuple of (address, port)

alias of Tuple[str, int]

class tslumd.sender.UmdSender(*args, **kwargs)[source]

Bases: pydispatch.dispatch.Dispatcher

Send UMD Messages

Messages are sent immediately when a change is made to any of the Tally objects in tallies. These can be added by using the add_tally() method.

Alternatively, the set_tally_color() and set_tally_text() methods may be used.

Parameters

clients – Intitial value for clients

tx_interval: float = 0.3

Interval to send tally messages, regardless of state changes

clients: Set[Tuple[str, int]]

Set of clients to send messages to

tallies: Dict[int, tslumd.tallyobj.Tally]

Mapping of Tally objects using the index as keys

Note

This should not be altered directly. Use add_tally() instead

running: bool

True if the client / server are running

loop: asyncio.base_events.BaseEventLoop

The asyncio.BaseEventLoop associated with the instance

async open()[source]

Open connections and begin data transmission

async close()[source]

Stop sending to clients and close connections

async send_scontrol(screen: int, data: bytes)[source]

Send an SCONTROL message

Parameters
  • screen – The screen for the message

  • data – The data to send in the scontrol field

New in version 0.0.2.

async send_broadcast_scontrol(data: bytes)[source]

Send a broadcast SCONTROL message

Parameters

data – The data to send in the scontrol field

New in version 0.0.2.

add_tally(index_: int, **kwargs)tslumd.tallyobj.Tally[source]

Create a Tally object and add it to tallies

Parameters
  • index – The tally index

  • **kwargs – Keyword arguments passed to create the tally instance

Raises

KeyError – If the given index_ already exists

set_tally_color(index_: int, tally_type: tslumd.common.TallyType, color: tslumd.common.TallyColor)[source]

Set the tally color for the given index and tally type

Parameters
  • index – The tally index

  • tally_type – A member of TallyType specifying the tally lamp within the display

  • color – The member of TallyColor to set

set_tally_text(index_: int, text: str)[source]

Set the tally text for the given index

Parameters
  • index – The tally index

  • text – The text to set

async send_tally_control(index_: int, data: bytes)[source]

Send control data for the given tally index

Parameters
  • index – The tally index

  • control – The control data to send

New in version 0.0.2.

async send_broadcast_tally_control(data: bytes, **kwargs)[source]

Send control data as broadcast to all listening displays

Parameters

**kwargs – Additional keyword arguments to pass to the Tally constructor

New in version 0.0.2.

async send_broadcast_tally(**kwargs)[source]

Send a broadcast update to all listening displays

Parameters

**kwargs – The keyword arguments to pass to the Tally constructor

New in version 0.0.2.