From 3b50de65d954dd39d0361669ccc6853ff4960506 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 22 Jul 2022 18:21:24 -0500 Subject: [PATCH] Document bluetooth.async_get_scanner (#1409) --- docs/network_discovery.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/network_discovery.md b/docs/network_discovery.md index b9bc7c67..f93b274c 100644 --- a/docs/network_discovery.md +++ b/docs/network_discovery.md @@ -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