Exemple #1
0
 def activate_output(self, universe: int) -> None:
     """
     Activates a universe that's then starting to sending every second.
     See http://tsp.esta.org/tsp/documents/docs/E1-31-2016.pdf for more information
     :param universe: the universe to activate
     """
     check_universe(universe)
     # check, if the universe already exists in the list:
     if universe in self._outputs:
         return
     # add new sending:
     new_output = Output(DataPacket(cid=self._sender_handler._CID, sourceName=self._sender_handler._source_name, universe=universe))
     self._outputs[universe] = new_output
def get_handler():
    cid = tuple(range(0, 16))
    source_name = 'test'
    outputs: Dict[int, Output] = {
        1: Output(packet=DataPacket(
            cid=cid,
            sourceName=source_name,
            universe=1,
        ))
    }
    socket = SenderSocketTest()
    handler = SenderHandler(
        cid=cid,
        source_name=source_name,
        outputs=outputs,
        bind_address='0.0.0.0',
        bind_port=5568,
        fps=30,
        socket=socket,
    )
    handler.manual_flush = True
    # wire up listener for tests
    socket._listener = handler
    return handler, socket, cid, source_name, outputs