Move local bluetooth scanner code into habluetooth library (#104970)

This commit is contained in:
J. Nick Koston 2023-12-05 07:19:02 -10:00 committed by GitHub
parent 428c184c75
commit b6245c834d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 180 additions and 592 deletions

View file

@ -2,7 +2,6 @@
from __future__ import annotations
from bluetooth_adapters import BluetoothAdapters
from bluetooth_auto_recovery import recover_adapter
from bluetooth_data_tools import monotonic_time_coarse
from homeassistant.core import callback
@ -69,11 +68,3 @@ def async_load_history_from_system(
connectable_loaded_history[address] = service_info
return all_loaded_history, connectable_loaded_history
async def async_reset_adapter(adapter: str | None, mac_address: str) -> bool | None:
"""Reset the adapter."""
if adapter and adapter.startswith("hci"):
adapter_id = int(adapter[3:])
return await recover_adapter(adapter_id, mac_address)
return False