Add the device match check to find devices.

Leave the example only in the section it is used.
This commit is contained in:
Danny Staple
2023-01-19 23:04:02 +00:00
parent 7907a3fecf
commit ccb94f4091
5 changed files with 5 additions and 113 deletions
@@ -1,13 +0,0 @@
import asyncio
import bleak
async def run():
ble_uuid = "6E400001-B5A3-F393-E0A9-E50E24DCCA9E"
ble_name = "Adafruit Bluefruit LE"
devices = await bleak.BleakScanner.discover(service_uuids=[ble_uuid])
print(f"Found {len(devices)} devices")
print([device.name for device in devices])
ble_device_info = [device for device in devices if device.name==ble_name][0]
print(f"Found robot {ble_device_info.name}...")
asyncio.run(run())