Added connect method

This commit is contained in:
BackwardsMonday 2022-09-26 10:43:31 -06:00
parent 22ef3b4da7
commit cce4e30c60

View File

@ -1,3 +1,16 @@
import asyncio
from time import sleep
from bleak import BleakScanner, BleakClient
class droid(): class droid():
def __init__(self, ipAdress): def __init__(self, ipAdress):
print("initizing")
self.ipAdress = ipAdress self.ipAdress = ipAdress
self.connection = asyncio.run(self.connect())
async def connect(self):
print("connecting")
async with BleakClient(self.ipAdress) as droid:
await droid.write_gatt_char(0x000d, 222001)
await droid.write_gatt_char(0x000d, 222001)
arms = droid("D4:D7:12:C5:93:C1")