1
0
Fork 0

more closely match the python-osc api

This commit is contained in:
Kevin Matz 2018-10-22 15:04:25 -04:00
parent 28a83d7557
commit dc4f2af308
1 changed files with 8 additions and 1 deletions

View File

@ -30,7 +30,14 @@ class HogDevice():
sleep(delay)
self.send_message(device, path, 0) # button up
# utility function to send simple messages with one argument
def send_message(self, device, path, arg):
msg = osc_message_builder.OscMessageBuilder(address=path)
msg.add_arg(arg)
self.send(device, msg.build())
# send python-osc messages
def send(self, device, msg):
if device is None:
osc = list(self.servers.values())[0]
else:
@ -45,7 +52,7 @@ class HogDevice():
logger.warn("Net# "+str(device.number.value)+" not found.")
logger.error("ERROR: macro discarded!")
return
osc.send_message(path, arg)
osc.send(msg)
def _master_go(self, ctx):
if ctx.number is not None: