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

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