Expose async_scanner_devices_by_address from the bluetooth api (#83733)

Co-authored-by: J. Nick Koston <nick@koston.org>
fixes undefined
This commit is contained in:
David Buezas 2023-01-09 01:06:32 +01:00 committed by GitHub
parent 06a35fb7db
commit 112b2c22f7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 179 additions and 47 deletions

View file

@ -13,7 +13,7 @@ from home_assistant_bluetooth import BluetoothServiceInfoBleak
from homeassistant.core import CALLBACK_TYPE, HomeAssistant, callback as hass_callback
from .base_scanner import BaseHaScanner
from .base_scanner import BaseHaScanner, BluetoothScannerDevice
from .const import DATA_MANAGER
from .manager import BluetoothManager
from .match import BluetoothCallbackMatcher
@ -93,6 +93,14 @@ def async_ble_device_from_address(
return _get_manager(hass).async_ble_device_from_address(address, connectable)
@hass_callback
def async_scanner_devices_by_address(
hass: HomeAssistant, address: str, connectable: bool = True
) -> list[BluetoothScannerDevice]:
"""Return all discovered BluetoothScannerDevice for an address."""
return _get_manager(hass).async_scanner_devices_by_address(address, connectable)
@hass_callback
def async_address_present(
hass: HomeAssistant, address: str, connectable: bool = True