-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Labels
bugSomething isn't workingSomething isn't workinghelp wantedExtra attention is neededExtra attention is neededpythonPython SDKPython SDK
Description
Can't get event loop from inside a coroutine, apparently. I have no idea how to fix this and it's probably because I should be doing this in a different way.
This code:
from communitysdk import list_connected_devices, MotionSensorKit
msk = None
devices = list_connected_devices()
if len(devices):
if isinstance(devices[0], MotionSensorKit):
msk = devices[0]
def on_proximity(p):
if p > 200:
try:
msk.set_mode('proximity')
except Exception as e:
print(e)
else:
print('proximity', p)
def on_gesture(g):
if g == 'up':
try:
msk.set_mode('proximity')
except Exception as e:
print(e)
else:
print('gesture', g)
msk.on_proximity = on_proximity
msk.on_gesture = on_gesture
else:
print('there is no device connected')
Prints There is no current event loop in thread 'ThreadPoolExecutor-0_0'.
when I swipe up on Motion Sensor.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinghelp wantedExtra attention is neededExtra attention is neededpythonPython SDKPython SDK