tslumd.receiver

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

Bases: 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_tally_control(tally: Tally, data: bytes)

Fired when control data has been received for a Tally

New in version 0.0.3.

on_screen_added(screen: Screen)

Fired when a Screen instance is added to screens

New in version 0.0.3.

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.

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

screens: dict[int, Screen]

Mapping of Screen objects by index

New in version 0.0.3.

broadcast_screen: Screen

A Screen instance created using Screen.broadcast()

New in version 0.0.3.

tallies: dict[Tuple[int, int], Tally]

Mapping of Tally objects by their id

Changed in version 0.0.3: The keys are now a combination of the Screen and Tally indices

running: bool

True if the client / server are running

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