tslumd.tallyobj
¶
-
class
tslumd.tallyobj.
Tally
(*args, **kwargs)[source]¶ Bases:
pydispatch.dispatch.Dispatcher
A single tally object
- Properties
-
-
normalized_brightness
: float → Property(float)¶ The
brightness
value normalized as a float from0.0
to1.0
-
- Events
New in version 0.0.2: The
on_control
event-
screen
: Optional[tslumd.tallyobj.Screen]¶ The parent
Screen
this tally belongs toNew in version 0.0.3.
-
property
id
→ typing.Tuple[int, int] [read-only]¶ A key to uniquely identify a
Tally
/Screen
combination.Tuple of (
Screen.index
,Tally.index
)- Raises
ValueError – If the
Tally.screen
isNone
New in version 0.0.3.
-
property
is_broadcast
→ bool [read-only]¶ True
if the tally is to be “broadcast”, meaning sent to alldisplay indices
.(if the
index
is0xffff
)New in version 0.0.2.
-
classmethod
broadcast
(**kwargs) → tslumd.tallyobj.Tally[source]¶ Create a
broadcast
tally(with
index
set to0xffff
)New in version 0.0.2.
-
classmethod
from_display
(display: tslumd.Display, **kwargs) → Tally[source]¶ Create an instance from the given
Display
object
-
update
(**kwargs) → Set[str][source]¶ Update any known properties from the given keyword-arguments
- Returns
The property names, if any, that changed
- Return type
-
update_from_display
(display: tslumd.messages.Display) → Set[str][source]¶ Update this instance from the values of the given
Display
object- Returns
The property names, if any, that changed
- Return type
-
class
tslumd.tallyobj.
Screen
(*args, **kwargs)[source]¶ Bases:
pydispatch.dispatch.Dispatcher
A group of
Tally
displays- Properties
- Events
-
-
on_tally_update
(tally: Tally, props_changed: Set[str])¶ Fired when any
Tally
property changes. This is a retransmission ofTally.on_update
-
on_tally_control
(tally: Tally, data: bytes)¶ Fired when control data is received for a
Tally
object. This is a retransmission ofTally.on_control
-
New in version 0.0.3.
-
tallies
: Dict[int, tslumd.tallyobj.Tally]¶ Mapping of
Tally
objects within the screen using theirindex
as keys
-
property
is_broadcast
→ bool [read-only]¶ True
if the screen is to be “broadcast”, meaning sent to allscreen indices
.(if the
index
is0xffff
)
-
classmethod
broadcast
(**kwargs) → tslumd.tallyobj.Screen[source]¶ -
(with
index
set to0xffff
)
-
broadcast_tally
(**kwargs) → tslumd.tallyobj.Tally[source]¶ Create a temporary
Tally
usingTally.broadcast()
- Parameters
**kwargs – Keyword arguments to pass to the
Tally
constructor
Note
The tally object is not stored in
tallies
and no event propagation (on_tally_added
,on_tally_update
,on_tally_control
) is handled by theScreen
.
-
add_tally
(index_: int, **kwargs) → tslumd.tallyobj.Tally[source]¶
-
get_or_create_tally
(index_: int) → tslumd.tallyobj.Tally[source]¶ If a
Tally
object matching the given index exists, return it. Otherwise create one and add it totallies
This method is similar to
add_tally()
and it can be used to avoid exception handling. It does not however take keyword arguments and is only intended for object creation.
-
update_from_message
(msg: tslumd.messages.Message)[source]¶ Handle an incoming
Message