diff --git a/homeassistant/components/thermobeacon/manifest.json b/homeassistant/components/thermobeacon/manifest.json index b231137d335..db5138b5550 100644 --- a/homeassistant/components/thermobeacon/manifest.json +++ b/homeassistant/components/thermobeacon/manifest.json @@ -54,5 +54,5 @@ "dependencies": ["bluetooth_adapters"], "documentation": "https://www.home-assistant.io/integrations/thermobeacon", "iot_class": "local_push", - "requirements": ["thermobeacon-ble==0.8.1"] + "requirements": ["thermobeacon-ble==0.9.0"] } diff --git a/requirements_all.txt b/requirements_all.txt index 5e62af28c30..5819b2e82f8 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -2906,7 +2906,7 @@ tessie-api==0.1.1 # tf-models-official==2.5.0 # homeassistant.components.thermobeacon -thermobeacon-ble==0.8.1 +thermobeacon-ble==0.9.0 # homeassistant.components.thermopro thermopro-ble==0.11.0 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index b7fb930195d..5f8f4724a8c 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -2344,7 +2344,7 @@ teslemetry-stream==0.7.5 tessie-api==0.1.1 # homeassistant.components.thermobeacon -thermobeacon-ble==0.8.1 +thermobeacon-ble==0.9.0 # homeassistant.components.thermopro thermopro-ble==0.11.0 diff --git a/tests/components/thermobeacon/__init__.py b/tests/components/thermobeacon/__init__.py index 2f7e220ebaa..32b6d823ec2 100644 --- a/tests/components/thermobeacon/__init__.py +++ b/tests/components/thermobeacon/__init__.py @@ -1,8 +1,48 @@ """Tests for the ThermoBeacon integration.""" -from homeassistant.helpers.service_info.bluetooth import BluetoothServiceInfo +from uuid import UUID -NOT_THERMOBEACON_SERVICE_INFO = BluetoothServiceInfo( +from bleak.backends.device import BLEDevice +from bluetooth_data_tools import monotonic_time_coarse + +from homeassistant.components.bluetooth import BluetoothServiceInfoBleak + + +def make_bluetooth_service_info( + name: str, + manufacturer_data: dict[int, bytes], + service_uuids: list[str], + address: str, + rssi: int, + service_data: dict[UUID, bytes], + source: str, + tx_power: int = 0, + raw: bytes | None = None, +) -> BluetoothServiceInfoBleak: + """Create a BluetoothServiceInfoBleak object for testing.""" + return BluetoothServiceInfoBleak( + name=name, + manufacturer_data=manufacturer_data, + service_uuids=service_uuids, + address=address, + rssi=rssi, + service_data=service_data, + source=source, + device=BLEDevice( + name=name, + address=address, + details={}, + rssi=rssi, + ), + time=monotonic_time_coarse(), + advertisement=None, + connectable=True, + tx_power=tx_power, + raw=raw, + ) + + +NOT_THERMOBEACON_SERVICE_INFO = make_bluetooth_service_info( name="Not it", address="61DE521B-F0BF-9F44-64D4-75BBE1738105", rssi=-63, @@ -12,7 +52,7 @@ NOT_THERMOBEACON_SERVICE_INFO = BluetoothServiceInfo( source="local", ) -THERMOBEACON_SERVICE_INFO = BluetoothServiceInfo( +THERMOBEACON_SERVICE_INFO = make_bluetooth_service_info( name="ThermoBeacon", address="aa:bb:cc:dd:ee:ff", rssi=-60,