示例#1
0
    def FetchDmx(self, universe, callback):
        """Fetch DMX data from the server

    Args:
      universe: the universe to fetch the data for
      callback: The function to call once complete, takes three arguments, a
        RequestStatus object, a universe number and a list of dmx data.

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

        controller = SimpleRpcController()
        request = Ola_pb2.UniverseRequest()
        request.universe = universe
        done = lambda x, y: self._GetDmxComplete(callback, x, y)
        try:
            self._stub.GetDmx(controller, request, done)
        except socket.error:
            raise OLADNotRunningException()
        return True
示例#2
0
    def FetchUIDList(self, universe, callback):
        """Used to get a list of UIDs for a particular universe.

    Args:
      universe: The universe to get the UID list for.
      callback: The function to call once complete, takes two arguments, a
        RequestStatus object and a iterable of UIDs.

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

        controller = SimpleRpcController()
        request = Ola_pb2.UniverseRequest()
        request.universe = universe
        done = lambda x, y: self._FetchUIDsComplete(callback, x, y)
        try:
            self._stub.GetUIDs(controller, request, done)
        except socket.error:
            raise OLADNotRunningException()
        return True