Added logic for this to run only if on main
This commit is contained in:
parent
a0db0dd040
commit
25f14de8b9
7
droid.py
7
droid.py
|
@ -137,7 +137,7 @@ async def main():
|
||||||
await d.led_off("1f")
|
await d.led_off("1f")
|
||||||
await d.play_sound("00", "00")
|
await d.play_sound("00", "00")
|
||||||
sleep(10)
|
sleep(10)
|
||||||
|
|
||||||
except OSError as err:
|
except OSError as err:
|
||||||
print(f"Discovery failed due to operating system: {err}")
|
print(f"Discovery failed due to operating system: {err}")
|
||||||
except BleakError as err:
|
except BleakError as err:
|
||||||
|
@ -145,4 +145,7 @@ async def main():
|
||||||
|
|
||||||
finally:
|
finally:
|
||||||
await d.disconnect()
|
await d.disconnect()
|
||||||
asyncio.run(main())
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
asyncio.run(main())
|
||||||
|
|
Loading…
Reference in New Issue
Block a user