mirror of
https://github.com/home-assistant/core.git
synced 2026-04-24 18:59:22 +01:00
Bump bluetooth deps for bleak 0.20 (#89925)
Co-authored-by: K <z@kwi.li>
This commit is contained in:
@@ -3,7 +3,6 @@ from datetime import timedelta
|
||||
import time
|
||||
from unittest.mock import patch
|
||||
|
||||
from bleak.backends.scanner import BLEDevice
|
||||
import pytest
|
||||
|
||||
from homeassistant.components.bluetooth import (
|
||||
@@ -24,6 +23,7 @@ from homeassistant.util import dt as dt_util
|
||||
from . import (
|
||||
FakeScanner,
|
||||
generate_advertisement_data,
|
||||
generate_ble_device,
|
||||
inject_advertisement_with_time_and_source,
|
||||
inject_advertisement_with_time_and_source_connectable,
|
||||
)
|
||||
@@ -41,7 +41,7 @@ async def test_advertisment_interval_shorter_than_adapter_stack_timeout(
|
||||
) -> None:
|
||||
"""Test we can determine the advertisement interval."""
|
||||
start_monotonic_time = time.monotonic()
|
||||
switchbot_device = BLEDevice("44:44:33:11:23:12", "wohand")
|
||||
switchbot_device = generate_ble_device("44:44:33:11:23:12", "wohand")
|
||||
switchbot_adv = generate_advertisement_data(
|
||||
local_name="wohand", service_uuids=["cba20d00-224d-11e6-9fb8-0002a5d5c51b"]
|
||||
)
|
||||
@@ -88,7 +88,7 @@ async def test_advertisment_interval_longer_than_adapter_stack_timeout_connectab
|
||||
) -> None:
|
||||
"""Test device with a long advertisement interval."""
|
||||
start_monotonic_time = time.monotonic()
|
||||
switchbot_device = BLEDevice("44:44:33:11:23:18", "wohand")
|
||||
switchbot_device = generate_ble_device("44:44:33:11:23:18", "wohand")
|
||||
switchbot_adv = generate_advertisement_data(
|
||||
local_name="wohand", service_uuids=["cba20d00-224d-11e6-9fb8-0002a5d5c51b"]
|
||||
)
|
||||
@@ -137,7 +137,7 @@ async def test_advertisment_interval_longer_than_adapter_stack_timeout_adapter_c
|
||||
) -> None:
|
||||
"""Test device with a long advertisement interval with an adapter change."""
|
||||
start_monotonic_time = time.monotonic()
|
||||
switchbot_device = BLEDevice("44:44:33:11:23:45", "wohand")
|
||||
switchbot_device = generate_ble_device("44:44:33:11:23:45", "wohand")
|
||||
switchbot_adv = generate_advertisement_data(
|
||||
local_name="wohand", service_uuids=["cba20d00-224d-11e6-9fb8-0002a5d5c51b"]
|
||||
)
|
||||
@@ -195,7 +195,7 @@ async def test_advertisment_interval_longer_than_adapter_stack_timeout_not_conne
|
||||
) -> None:
|
||||
"""Test device with a long advertisement interval that is not connectable not reaching the advertising interval."""
|
||||
start_monotonic_time = time.monotonic()
|
||||
switchbot_device = BLEDevice("44:44:33:11:23:45", "wohand")
|
||||
switchbot_device = generate_ble_device("44:44:33:11:23:45", "wohand")
|
||||
switchbot_adv = generate_advertisement_data(
|
||||
local_name="wohand", service_uuids=["cba20d00-224d-11e6-9fb8-0002a5d5c51b"]
|
||||
)
|
||||
@@ -247,7 +247,7 @@ async def test_advertisment_interval_shorter_than_adapter_stack_timeout_adapter_
|
||||
) -> None:
|
||||
"""Test device with a short advertisement interval with an adapter change that is not connectable."""
|
||||
start_monotonic_time = time.monotonic()
|
||||
switchbot_device = BLEDevice("44:44:33:11:23:5C", "wohand")
|
||||
switchbot_device = generate_ble_device("44:44:33:11:23:5C", "wohand")
|
||||
switchbot_adv = generate_advertisement_data(
|
||||
local_name="wohand",
|
||||
service_uuids=["cba20d00-224d-11e6-9fb8-0002a5d5c51b"],
|
||||
@@ -315,7 +315,7 @@ async def test_advertisment_interval_longer_than_adapter_stack_timeout_adapter_c
|
||||
) -> None:
|
||||
"""Test device with a long advertisement interval with an adapter change that is not connectable."""
|
||||
start_monotonic_time = time.monotonic()
|
||||
switchbot_device = BLEDevice("44:44:33:11:23:45", "wohand")
|
||||
switchbot_device = generate_ble_device("44:44:33:11:23:45", "wohand")
|
||||
switchbot_adv = generate_advertisement_data(
|
||||
local_name="wohand",
|
||||
service_uuids=["cba20d00-224d-11e6-9fb8-0002a5d5c51b"],
|
||||
@@ -416,7 +416,7 @@ async def test_advertisment_interval_longer_increasing_than_adapter_stack_timeou
|
||||
) -> None:
|
||||
"""Test device with a increasing advertisement interval with an adapter change that is not connectable."""
|
||||
start_monotonic_time = time.monotonic()
|
||||
switchbot_device = BLEDevice("44:44:33:11:23:45", "wohand")
|
||||
switchbot_device = generate_ble_device("44:44:33:11:23:45", "wohand")
|
||||
switchbot_adv = generate_advertisement_data(
|
||||
local_name="wohand", service_uuids=["cba20d00-224d-11e6-9fb8-0002a5d5c51b"]
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user