Skip to content

Commit

Permalink
Solving error when establishing connection (#57)
Browse files Browse the repository at this point in the history
AttributeError: 'NoneType' object has no attribute 'transformBothSpeeds'
  • Loading branch information
R0M107 authored Aug 20, 2024
1 parent aee701e commit 741bd7d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/pyjoystick_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ async def run():
bleLubaConn = LubaBLE(bleNotificationEvt)
did_connect = await bleLubaConn.scanForLubaAndConnect()
if not did_connect:
print("Couldn't establish connection with the device")
return
await bleLubaConn.notifications()
client = bleLubaConn.getClient()
Expand All @@ -177,6 +178,7 @@ async def handle_notifications(data: bytearray):
event_loop = asyncio.new_event_loop()
asyncio.set_event_loop(event_loop)
client = event_loop.run_until_complete(run())
joystick = JoystickControl(client)
joystick.run_controller()
event_loop.run_forever()
if client:
joystick = JoystickControl(client)
joystick.run_controller()
event_loop.run_forever()

0 comments on commit 741bd7d

Please sign in to comment.