From 2abe80dc88c3a9f98d35c2cfea12c260700eb1b0 Mon Sep 17 00:00:00 2001 From: David Lechner Date: Wed, 14 Jun 2023 09:23:54 -0500 Subject: [PATCH] docs/troubleshooting: fix missing await Also fix missing `:` and don't create unnecessary instance of BleakScanner. Fixes: https://github.com/hbldh/bleak/issues/1334 --- docs/troubleshooting.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/troubleshooting.rst b/docs/troubleshooting.rst index 0b139522..441dcade 100644 --- a/docs/troubleshooting.rst +++ b/docs/troubleshooting.rst @@ -103,9 +103,9 @@ Python:: from bleak.backends.device import BLEDevice - async def find_all_devices_services() - scanner = BleakScanner() - devices: Sequence[BLEDevice] = scanner.discover(timeout=5.0) + async def find_all_devices_services(): + devices: Sequence[BLEDevice] = await BleakScanner.discover(timeout=5.0) + for d in devices: async with BleakClient(d) as client: print(client.services)