예제 #1
0
def ArtNetConfigureReply(state, response):
  reply = ArtNetConfigMessages_pb2.Reply()
  reply.ParseFromString(response)
  print('Short Name: %s' % reply.options.short_name)
  print('Long Name: %s' % reply.options.long_name)
  print('Subnet: %d' % reply.options.subnet)
  wrapper.Stop()
예제 #2
0
def main():
    # Set this appropriately
    device_alias = 1
    global wrapper
    wrapper = ClientWrapper()
    client = wrapper.Client()
    artnet_request = ArtNetConfigMessages_pb2.Request()
    artnet_request.type = artnet_request.ARTNET_OPTIONS_REQUEST
    client.ConfigureDevice(device_alias, artnet_request.SerializeToString(),
                           ArtNetConfigureReply)
    wrapper.Run()
예제 #3
0
def ArtNetConfigureReply(status, response):
    if status.Succeeded():
        reply = ArtNetConfigMessages_pb2.Reply()
        reply.ParseFromString(response)
        print('Short Name: %s' % reply.options.short_name)
        print('Long Name: %s' % reply.options.long_name)
        print('Subnet: %d' % reply.options.subnet)
    else:
        print('Error: %s' % status.message, file=sys.stderr)

    global wrapper
    if wrapper:
        wrapper.Stop()
예제 #4
0
#
# ola_artnet_params.py
# Copyright (C) 2005 Simon Newton

"""Fetch some ArtNet parameters."""

__author__ = '[email protected] (Simon Newton)'

from ola.ClientWrapper import ClientWrapper
from ola import ArtNetConfigMessages_pb2


def ArtNetConfigureReply(state, response):
  reply = ArtNetConfigMessages_pb2.Reply()
  reply.ParseFromString(response)
  print('Short Name: %s' % reply.options.short_name)
  print('Long Name: %s' % reply.options.long_name)
  print('Subnet: %d' % reply.options.subnet)
  wrapper.Stop()


# Set this appropriately
device_alias = 1
wrapper = ClientWrapper()
client = wrapper.Client()
artnet_request = ArtNetConfigMessages_pb2.Request()
artnet_request.type = artnet_request.ARTNET_OPTIONS_REQUEST
client.ConfigureDevice(device_alias, artnet_request.SerializeToString(),
                       ArtNetConfigureReply)
wrapper.Run()