Пример #1
0
    def UpdateDmxData(self, controller, request, callback):
        """Called when we receive new DMX data.

    Args:
      controller: An RpcController object
      reqeust: A DmxData message
      callback: The callback to run once complete
    """
        if request.universe in self._universe_callbacks:
            data = array.array('B')
            data.fromstring(request.data)
            self._universe_callbacks[request.universe](data)
        response = Ola_pb2.Ack()
        callback(response)
Пример #2
0
  def UpdateDmxData(self, controller, request, callback):
    """Called when we receive new DMX data.

    Args:
      controller: An RpcController object
      request: A DmxData message
      callback: The callback to run once complete

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

    if request.universe in self._universe_callbacks:
      data = array.array('B', request.data)
      self._universe_callbacks[request.universe](data)
    response = Ola_pb2.Ack()
    callback(response)
    return True