Document bluetooth.async_get_scanner (#1409)

This commit is contained in:
J. Nick Koston 2022-07-22 18:21:24 -05:00 committed by GitHub
parent e998f5b7c6
commit 3b50de65d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -77,6 +77,15 @@ entry.async_on_unload(
)
```
### Fetch the shared BleakScanner instance
Integrations that need an instance of a `BleakScanner` should call the `bluetooth.async_get_scanner` API. This API returns a wrapper around a single `BleakScanner` that allows integrations to share without overloading the system.
```python
from homeassistant.components import bluetooth
scanner = bluetooth.async_get_scanner(hass)
```
### Subscribing to unavailable callbacks