Changed naming convention to "d" for droid

This commit is contained in:
hornet 2022-10-09 00:40:01 -04:00
parent 15315e06c2
commit cdf02633e4

View File

@ -1,7 +1,7 @@
import asyncio import asyncio
from time import sleep from time import sleep
from bleak import BleakScanner, BleakClient from bleak import BleakScanner, BleakClient
import pickle
class Droid(): class Droid():
def __init__(self, profile): def __init__(self, profile):
print("Initializing") print("Initializing")
@ -103,8 +103,8 @@ def findDroid(candidate, data):
async def main(): async def main():
myDroid = await BleakScanner.find_device_by_filter(findDroid) myDroid = await BleakScanner.find_device_by_filter(findDroid)
print (myDroid) print (myDroid)
arms = Droid(myDroid) d = Droid(myDroid)
await arms.connect() await d.connect()
sleep (3) sleep (3)
try: try:
# await arms.run_routine("05") # await arms.run_routine("05")
@ -117,16 +117,16 @@ async def main():
# sleep(5) # sleep(5)
# await arms.play_sound("00", "00") # await arms.play_sound("00", "00")
# sleep(8) # sleep(8)
await arms.led_disable_sound("01") await d.led_disable_sound("01")
await arms.play_sound("00", "00") await d.play_sound("00", "00")
sleep(10) sleep(10)
await arms.led_on("1f") await d.led_on("1f")
sleep(10) sleep(10)
await arms.led_off("1f") await d.led_off("1f")
await arms.play_sound("00", "00") await d.play_sound("00", "00")
sleep(10) sleep(10)
finally: finally:
await arms.disconnect() await d.disconnect()
asyncio.run(main()) asyncio.run(main())