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:
parent
06a35fb7db
commit
112b2c22f7
6 changed files with 179 additions and 47 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue