Пример #1
0
    def SendDmx(self, universe, data, callback=None):
        """Send DMX data to the server

    Args:
      universe: the universe to send the data for
      data: An array object with the DMX data
      callback: The function to call once complete, takes one argument, a
        RequestStatus object.

    Returns:
      True if the request was sent, False otherwise.
    """
        if self._socket is None:
            return False

        controller = SimpleRpcController()
        request = Ola_pb2.DmxData()
        request.universe = universe
        request.data = data.tostring()
        done = lambda x, y: self._AckMessageComplete(callback, x, y)
        try:
            self._stub.UpdateDmxData(controller, request, done)
        except socket.error:
            raise OLADNotRunningException()
        return True
Пример #2
0
    def SendDmx(self, universe, data, callback=None):
        """Send DMX data to the server

    Args:
      universe: the universe to fetch the data for
      data: An array object with the DMX data
      callback: The function to call once complete, takes one argument, a
        RequestStatus object.
    """
        controller = SimpleRpcController()
        request = Ola_pb2.DmxData()
        request.universe = universe
        request.data = data.tostring()
        done = lambda x, y: self._AckMessageComplete(callback, x, y)
        self._stub.UpdateDmxData(controller, request, done)