tslumd.receiver

class tslumd.receiver.UmdReceiver(*args, **kwargs)[source]

Bases: pydispatch.dispatch.Dispatcher

Receiver for UMD messages

Parameters
  • hostaddr (str) – The local host address to bind the server to. Defaults to DEFAULT_HOST

  • hostport (int) – The port to listen on. Defaults to DEFAULT_PORT

Events
on_tally_added(tally: Tally)

Fired when a Tally instance is added to tallies

on_tally_updated(tally: Tally)

Fired when any Tally instance has been updated

on_scontrol(screen: int, data: bytes)

Fired when a message with scontrol data is received

  • screen : The screen from the incoming control message

  • data : The control data

New in version 0.0.2: The on_scontrol event

DEFAULT_HOST: str = '0.0.0.0'

The default host address to listen on

DEFAULT_PORT: int = 65000

The default host port to listen on

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

Mapping of Tally objects using the index as keys

loop: asyncio.base_events.BaseEventLoop

The asyncio.BaseEventLoop associated with the instance

running: bool

True if the client / server are running

property hostaddrstr   [read-only]

The local host address to bind the server to

property hostportint   [read-only]

The port to listen on

async open()[source]

Open the server

async close()[source]

Close the server

async set_bind_address(hostaddr: str, hostport: int)[source]

Set the hostaddr and hostport and restart the server

async set_hostaddr(hostaddr: str)[source]

Set the hostaddr and restart the server

async set_hostport(hostport: int)[source]

Set the hostport and restart the server

parse_incoming(data: bytes, addr: Tuple[str, int])[source]

Parse data received by the server

update_display(rx_display: tslumd.messages.Display)[source]

Update or create a Tally from data received by the server

If data received is a broadcast display, all existing tallies are updated

New in version 0.0.2: Broadcast support