Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions monome.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ async def connect(self, host, port, loop=None):
loop = asyncio.get_event_loop()

transport, protocol = await loop.create_datagram_endpoint(lambda: self,
local_addr=('127.0.0.1', 0),
remote_addr=(host, port))

def disconnect(self):
Expand Down Expand Up @@ -237,16 +236,16 @@ def connection_made(self, transport):
self.send('/serialosc/list', self.host, self.port)
self.send('/serialosc/notify', self.host, self.port)

async def connect(self, loop=None):
async def connect(self, host='127.0.0.1', loop=None):
if loop is None:
if sys.version_info >= (3, 7):
loop = asyncio.get_running_loop()
else:
loop = asyncio.get_event_loop()

transport, protocol = await loop.create_datagram_endpoint(lambda: self,
local_addr=('127.0.0.1', 0),
remote_addr=('127.0.0.1', 12002))
transport, protocol = await loop.create_datagram_endpoint(
lambda: self, remote_addr=(host, 12002),
)

def _on_serialosc_device(self, addr, path, id, type, port):
type = type.strip() # remove trailing spaces for arcs
Expand Down