Bump habluetooth to 5.0.1 (#150320)

This commit is contained in:
J. Nick Koston
2025-08-10 02:41:25 -05:00
committed by GitHub
parent dfa060a7e1
commit d821d27730
6 changed files with 17 additions and 17 deletions

View File

@@ -388,12 +388,6 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
mode = BluetoothScanningMode.PASSIVE if passive else BluetoothScanningMode.ACTIVE
scanner = HaScanner(mode, adapter, address)
scanner.async_setup()
try:
await scanner.async_start()
except (RuntimeError, ScannerStartError) as err:
raise ConfigEntryNotReady(
f"{adapter_human_name(adapter, address)}: {err}"
) from err
adapters = await manager.async_get_bluetooth_adapters()
details = adapters[adapter]
if entry.title == address:
@@ -401,8 +395,16 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
entry, title=adapter_title(adapter, details)
)
slots: int = details.get(ADAPTER_CONNECTION_SLOTS) or DEFAULT_CONNECTION_SLOTS
# Register the scanner before starting so
# any raw advertisement data can be processed
entry.async_on_unload(async_register_scanner(hass, scanner, connection_slots=slots))
await async_update_device(hass, entry, adapter, details)
try:
await scanner.async_start()
except (RuntimeError, ScannerStartError) as err:
raise ConfigEntryNotReady(
f"{adapter_human_name(adapter, address)}: {err}"
) from err
entry.async_on_unload(entry.add_update_listener(async_update_listener))
entry.async_on_unload(scanner.async_stop)
return True

View File

@@ -235,7 +235,6 @@ class HomeAssistantBluetoothManager(BluetoothManager):
def _async_save_scanner_history(self, scanner: BaseHaScanner) -> None:
"""Save the scanner history."""
if isinstance(scanner, BaseHaRemoteScanner):
self.storage.async_set_advertisement_history(
scanner.source, scanner.serialize_discovered_devices()
)
@@ -285,7 +284,6 @@ class HomeAssistantBluetoothManager(BluetoothManager):
connection_slots: int | None = None,
) -> CALLBACK_TYPE:
"""Register a scanner."""
if isinstance(scanner, BaseHaRemoteScanner):
if history := self.storage.async_get_advertisement_history(scanner.source):
scanner.restore_discovered_devices(history)

View File

@@ -21,6 +21,6 @@
"bluetooth-auto-recovery==1.5.2",
"bluetooth-data-tools==1.28.2",
"dbus-fast==2.44.3",
"habluetooth==4.0.2"
"habluetooth==5.0.1"
]
}

View File

@@ -34,7 +34,7 @@ dbus-fast==2.44.3
fnv-hash-fast==1.5.0
go2rtc-client==0.2.1
ha-ffmpeg==3.2.2
habluetooth==4.0.2
habluetooth==5.0.1
hass-nabucasa==0.111.2
hassil==2.2.3
home-assistant-bluetooth==1.13.1

2
requirements_all.txt generated
View File

@@ -1130,7 +1130,7 @@ ha-silabs-firmware-client==0.2.0
habiticalib==0.4.1
# homeassistant.components.bluetooth
habluetooth==4.0.2
habluetooth==5.0.1
# homeassistant.components.cloud
hass-nabucasa==0.111.2

View File

@@ -991,7 +991,7 @@ ha-silabs-firmware-client==0.2.0
habiticalib==0.4.1
# homeassistant.components.bluetooth
habluetooth==4.0.2
habluetooth==5.0.1
# homeassistant.components.cloud
hass-nabucasa==0.111.2