Update habluetooth to 2.0.0 (#106145)

This commit is contained in:
J. Nick Koston 2023-12-20 20:37:39 -10:00 committed by GitHub
parent dbb726f41f
commit e50fe79911
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 53 additions and 60 deletions

View file

@ -107,7 +107,8 @@ async def test_wrapped_bleak_client_local_adapter_only(
"00:00:00:00:00:01",
"hci0",
)
cancel = manager.async_register_scanner(scanner, True)
scanner.connectable = True
cancel = manager.async_register_scanner(scanner)
inject_advertisement_with_source(
hass, switchbot_device, switchbot_adv, "00:00:00:00:00:01"
)
@ -187,7 +188,7 @@ async def test_wrapped_bleak_client_set_disconnected_callback_after_connected(
connector,
True,
)
cancel = manager.async_register_scanner(scanner, True)
cancel = manager.async_register_scanner(scanner)
inject_advertisement_with_source(
hass, switchbot_device, switchbot_adv, "00:00:00:00:00:01"
)
@ -291,7 +292,7 @@ async def test_ble_device_with_proxy_client_out_of_connections(
connector = HaBluetoothConnector(MockBleakClient, "esp32", lambda: False)
scanner = FakeScanner("esp32", "esp32", connector, True)
cancel = manager.async_register_scanner(scanner, True)
cancel = manager.async_register_scanner(scanner)
inject_advertisement_with_source(
hass, switchbot_proxy_device_no_connection_slot, switchbot_adv, "esp32"
)
@ -356,7 +357,7 @@ async def test_ble_device_with_proxy_clear_cache(
connector = HaBluetoothConnector(MockBleakClient, "esp32", lambda: True)
scanner = FakeScanner("esp32", "esp32", connector, True)
cancel = manager.async_register_scanner(scanner, True)
cancel = manager.async_register_scanner(scanner)
inject_advertisement_with_source(
hass, switchbot_proxy_device_with_connection_slot, switchbot_adv, "esp32"
)
@ -466,7 +467,7 @@ async def test_ble_device_with_proxy_client_out_of_connections_uses_best_availab
connector,
True,
)
cancel = manager.async_register_scanner(scanner, True)
cancel = manager.async_register_scanner(scanner)
assert manager.async_discovered_devices(True) == [
switchbot_proxy_device_no_connection_slot
]
@ -578,7 +579,7 @@ async def test_ble_device_with_proxy_client_out_of_connections_uses_best_availab
connector,
True,
)
cancel = manager.async_register_scanner(scanner, True)
cancel = manager.async_register_scanner(scanner)
assert manager.async_discovered_devices(True) == [
switchbot_proxy_device_no_connection_slot
]