pb_client.service.Service.watching_adapters
async
¶
watching_adapters()
Follow which Bluetooth adapters cannot be used, while hubs are sought.
Only a scan or a connection looking for a hub reports this, and only on a change, so open this around one of those. What it is for: on macOS the first use of Bluetooth Classic makes the system ask the user whether the service may use Bluetooth, and nothing is found until they answer. Telling them as soon as that happens, rather than when the search gives up, is the difference between a dialog answered and one nobody noticed. Meanwhile the service holds the search's time limit still, and once the dialog is answered the search carries on.
Yields:
| Type | Description |
|---|---|
AsyncGenerator[AsyncIterator[tuple[UnusableAdapter, ...]], None]
|
Each change: every adapter that cannot be used, or an empty tuple |
AsyncGenerator[AsyncIterator[tuple[UnusableAdapter, ...]], None]
|
once all can again. Ends when the block is left. |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If this connection has no notification router, which would leave the iterator silently empty. |