jvconnected.interfaces.tslumd

jvconnected.interfaces.tslumd.umd_io

class jvconnected.interfaces.tslumd.umd_io.UmdIo(*args, **kwargs)[source]

Bases: jvconnected.interfaces.base.Interface

Main UMD interface

Properties
hostaddr: str Property(str)

Alias for tslumd.receiver.UmdReceiver.hostaddr

hostport: int Property(int)

Alias for tslumd.receiver.UmdReceiver.hostport

device_maps: Dict[int, DeviceMapping] Property(Dict[int, DeviceMapping])

A dict of DeviceMapping definitions stored with their device_index as keys

mapped_devices: Dict[int, MappedDevice] Property(Dict[int, MappedDevice])

A dict of MappedDevice stored with the device_index of their map as keys

Events
on_tally_added(tally: Tally)

Fired when a tslumd.tallyobj.Tally instance is added to tallies

on_tally_updated(tally: Tally)

Fired when any tslumd.tallyobj.Tally instance has been updated

property tallies typing.Dict[int, tslumd.tallyobj.Tally]   [read-only]

Alias for tslumd.receiver.UmdReceiver.tallies

async set_engine(engine: jvconnected.engine.Engine)[source]

Attach the interface to a running instance of jvconnected.engine.Engine

This will be called automatically by the engine if the class is in the jvconnected.interfaces.registry.

If the engine is running, the interface will start (using the open() method). Otherwise it will automatically start when the engine does.

async open()[source]

Open all communication methods

async close()[source]

Stop communication

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

async add_device_mapping(device_map: jvconnected.interfaces.tslumd.mapper.DeviceMapping)[source]

Add a DeviceMapping definition to device_maps and update the config.

An instance of MappedDevice is also created and associated with its Device if found in the engine.

async remove_device_mapping(device_index: int)[source]

Remove a DeviceMapping and its associated MappedDevice by the given device index

update_config(*args, **kwargs)[source]

Update the config with current state

jvconnected.interfaces.tslumd.mapper

class jvconnected.interfaces.tslumd.mapper.TallyMap(screen_index: int = 0, tally_index: int = 0, tally_type: tslumd.common.TallyType = TallyType.no_tally)[source]

Bases: object

Map to a single tally type within a specific tslumd.tallyobj.Tally by its index

screen_index: int = 0

The tslumd.tallyobj.Screen.index

tally_index: int = 0

The index

tally_type: tslumd.common.TallyType = 0

The TallyType

class jvconnected.interfaces.tslumd.mapper.DeviceMapping(device_index: int, program: jvconnected.interfaces.tslumd.mapper.TallyMap = <factory>, preview: jvconnected.interfaces.tslumd.mapper.TallyMap = <factory>)[source]

Bases: object

Map the preview and program tallies from UMD to a jvconnected.device.Device

This only defines the mapping, the functionality itself is carried out by MappedDevice.

device_index: int

The device_index to associate with this mapping

program: jvconnected.interfaces.tslumd.mapper.TallyMap

Definition for program tally

preview: jvconnected.interfaces.tslumd.mapper.TallyMap

Definition for preview tally

class jvconnected.interfaces.tslumd.mapper.MappedDevice(umd_io: jvconnected.interfaces.tslumd.umd_io.UmdIo, map: jvconnected.interfaces.tslumd.mapper.DeviceMapping)[source]

Bases: object

Link between Tally objects and a jvconnected.device.Device

umd_io: jvconnected.interfaces.tslumd.umd_io.UmdIo

UmdIo instance

map: jvconnected.interfaces.tslumd.mapper.DeviceMapping

Mapping definitions for the device

device: Optional[jvconnected.device.Device]

The device instance

program_tally: Optional[jvconnected.interfaces.tslumd.mapper.TallyMap]

The Tally mapped to jvconnected.device.TallyParams.program

preview_tally: Optional[jvconnected.interfaces.tslumd.mapper.TallyMap]

The Tally mapped to jvconnected.device.TallyParams.preview

tally_state: tslumd.common.TallyState

The current state

async set_device(device: Optional[jvconnected.device.Device])[source]

Set the device and update its tally state

get_tallies() bool[source]

Attempt to find the Tally objects in the umd_io

Returns

True if an update is needed

(a tally object either changed or was found)

Return type

bool

update_tally_state(*args, **kwargs)[source]

Update the tally_state using both program_tally and preview_tally. Since they are mutually exclusive in the device, priority is given to program_tally.

Returns

True if the state changed

Return type

bool

async update_device_tally(*args, **kwargs)[source]

Update the tally state (using update_tally_state()) and send changes to the device