mirror of
https://github.com/home-assistant/core.git
synced 2025-09-06 05:11:35 +02:00
Bump habluetooth to 5.0.1 (#150320)
This commit is contained in:
@@ -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
|
||||
|
@@ -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)
|
||||
|
||||
|
@@ -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"
|
||||
]
|
||||
}
|
||||
|
@@ -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
2
requirements_all.txt
generated
@@ -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
|
||||
|
2
requirements_test_all.txt
generated
2
requirements_test_all.txt
generated
@@ -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
|
||||
|
Reference in New Issue
Block a user