Bump habluetooth to 2.5.2 (#115721)

This commit is contained in:
J. Nick Koston 2024-04-16 18:34:57 -05:00 committed by GitHub
parent e7076ac83f
commit 6dcfe861fd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 121 additions and 120 deletions

View File

@ -20,6 +20,6 @@
"bluetooth-auto-recovery==1.4.0",
"bluetooth-data-tools==1.19.0",
"dbus-fast==2.21.1",
"habluetooth==2.4.2"
"habluetooth==2.5.2"
]
}

View File

@ -28,7 +28,7 @@ dbus-fast==2.21.1
fnv-hash-fast==0.5.0
ha-av==10.1.1
ha-ffmpeg==3.2.0
habluetooth==2.4.2
habluetooth==2.5.2
hass-nabucasa==0.78.0
hassil==1.6.1
home-assistant-bluetooth==1.12.0

View File

@ -1029,7 +1029,7 @@ ha-philipsjs==3.1.1
habitipy==0.2.0
# homeassistant.components.bluetooth
habluetooth==2.4.2
habluetooth==2.5.2
# homeassistant.components.cloud
hass-nabucasa==0.78.0

View File

@ -843,7 +843,7 @@ ha-philipsjs==3.1.1
habitipy==0.2.0
# homeassistant.components.bluetooth
habluetooth==2.4.2
habluetooth==2.5.2
# homeassistant.components.cloud
hass-nabucasa==0.78.0

View File

@ -22,7 +22,6 @@ from homeassistant.setup import async_setup_component
from homeassistant.util import dt as dt_util
from . import (
_get_manager,
async_setup_with_one_adapter,
generate_advertisement_data,
generate_ble_device,
@ -183,7 +182,7 @@ async def test_adapter_needs_reset_at_start(
with (
patch(
"habluetooth.scanner.OriginalBleakScanner.start",
side_effect=[BleakError(error), None],
side_effect=[BleakError(error), BleakError(error), None],
),
patch(
"habluetooth.util.recover_adapter", return_value=True
@ -274,7 +273,8 @@ async def test_recovery_from_dbus_restart(
start_time_monotonic + SCANNER_WATCHDOG_TIMEOUT + 20,
):
async_fire_time_changed(
hass, dt_util.utcnow() + SCANNER_WATCHDOG_INTERVAL + timedelta(seconds=20)
hass,
dt_util.utcnow() + SCANNER_WATCHDOG_INTERVAL + timedelta(seconds=20),
)
await hass.async_block_till_done()
@ -327,7 +327,6 @@ async def test_adapter_recovery(hass: HomeAssistant, one_adapter: None) -> None:
assert called_start == 1
scanner = _get_manager()
mock_discovered = [MagicMock()]
# Ensure we don't restart the scanner if we don't need to
@ -418,7 +417,6 @@ async def test_adapter_scanner_fails_to_start_first_time(
assert called_start == 1
scanner = _get_manager()
mock_discovered = [MagicMock()]
# Ensure we don't restart the scanner if we don't need to
@ -454,14 +452,15 @@ async def test_adapter_scanner_fails_to_start_first_time(
await hass.async_block_till_done()
assert len(mock_recover_adapter.mock_calls) == 1
assert called_start == 3
assert called_start == 4
now_monotonic = time.monotonic()
# We hit the timer again the previous start call failed, make sure
# we try again
with (
patch_bluetooth_time(
start_time_monotonic
+ SCANNER_WATCHDOG_TIMEOUT
now_monotonic
+ SCANNER_WATCHDOG_TIMEOUT * 2
+ SCANNER_WATCHDOG_INTERVAL.total_seconds(),
),
patch(
@ -472,7 +471,7 @@ async def test_adapter_scanner_fails_to_start_first_time(
await hass.async_block_till_done()
assert len(mock_recover_adapter.mock_calls) == 1
assert called_start == 4
assert called_start == 5
async def test_adapter_fails_to_start_and_takes_a_bit_to_init(
@ -497,9 +496,11 @@ async def test_adapter_fails_to_start_and_takes_a_bit_to_init(
nonlocal called_start
called_start += 1
if called_start == 1:
raise BleakError("org.bluez.Error.InProgress")
if called_start == 2:
raise BleakError("org.freedesktop.DBus.Error.UnknownObject")
if called_start == 2:
raise BleakError("org.bluez.Error.InProgress")
if called_start == 3:
raise BleakError("org.bluez.Error.InProgress")
async def stop(self, *args, **kwargs):
"""Mock Start."""
@ -538,7 +539,7 @@ async def test_adapter_fails_to_start_and_takes_a_bit_to_init(
):
await async_setup_with_one_adapter(hass)
assert called_start == 3
assert called_start == 4
assert len(mock_recover_adapter.mock_calls) == 1
assert "Waiting for adapter to initialize" in caplog.text