droidDepotPythonControl/droid.py

16 lines
505 B
Python
Raw Normal View History

2022-09-26 16:43:31 +00:00
import asyncio
from time import sleep
from bleak import BleakScanner, BleakClient
2022-09-26 01:25:27 +00:00
class droid():
def __init__(self, ipAdress):
2022-09-26 16:43:31 +00:00
print("initizing")
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")