diff --git a/homeassistant/components/thermopro/manifest.json b/homeassistant/components/thermopro/manifest.json index 6027e4bc99c..127529f01c0 100644 --- a/homeassistant/components/thermopro/manifest.json +++ b/homeassistant/components/thermopro/manifest.json @@ -24,5 +24,5 @@ "dependencies": ["bluetooth_adapters"], "documentation": "https://www.home-assistant.io/integrations/thermopro", "iot_class": "local_push", - "requirements": ["thermopro-ble==0.11.0"] + "requirements": ["thermopro-ble==0.12.0"] } diff --git a/requirements_all.txt b/requirements_all.txt index 469038ea821..3dc505b9949 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -2909,7 +2909,7 @@ tessie-api==0.1.1 thermobeacon-ble==0.9.0 # homeassistant.components.thermopro -thermopro-ble==0.11.0 +thermopro-ble==0.12.0 # homeassistant.components.thingspeak thingspeak==1.0.0 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 93809dd2142..5c0a667d0f5 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -2347,7 +2347,7 @@ tessie-api==0.1.1 thermobeacon-ble==0.9.0 # homeassistant.components.thermopro -thermopro-ble==0.11.0 +thermopro-ble==0.12.0 # homeassistant.components.lg_thinq thinqconnect==1.0.5 diff --git a/tests/components/thermopro/__init__.py b/tests/components/thermopro/__init__.py index d3cba26858f..7ac593e6336 100644 --- a/tests/components/thermopro/__init__.py +++ b/tests/components/thermopro/__init__.py @@ -1,8 +1,48 @@ """Tests for the ThermoPro integration.""" -from homeassistant.helpers.service_info.bluetooth import BluetoothServiceInfo +from uuid import UUID -NOT_THERMOPRO_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_THERMOPRO_SERVICE_INFO = make_bluetooth_service_info( name="Not it", address="61DE521B-F0BF-9F44-64D4-75BBE1738105", rssi=-63, @@ -13,7 +53,7 @@ NOT_THERMOPRO_SERVICE_INFO = BluetoothServiceInfo( ) -TP357_SERVICE_INFO = BluetoothServiceInfo( +TP357_SERVICE_INFO = make_bluetooth_service_info( name="TP357 (2142)", manufacturer_data={61890: b"\x00\x1d\x02,"}, service_uuids=[], @@ -23,7 +63,7 @@ TP357_SERVICE_INFO = BluetoothServiceInfo( source="local", ) -TP358_SERVICE_INFO = BluetoothServiceInfo( +TP358_SERVICE_INFO = make_bluetooth_service_info( name="TP358 (4221)", manufacturer_data={61890: b"\x00\x1d\x02,"}, service_uuids=[], @@ -33,7 +73,7 @@ TP358_SERVICE_INFO = BluetoothServiceInfo( source="local", ) -TP962R_SERVICE_INFO = BluetoothServiceInfo( +TP962R_SERVICE_INFO = make_bluetooth_service_info( name="TP962R (0000)", manufacturer_data={14081: b"\x00;\x0b7\x00"}, service_uuids=["72fbb631-6f6b-d1ba-db55-2ee6fdd942bd"], @@ -43,7 +83,7 @@ TP962R_SERVICE_INFO = BluetoothServiceInfo( source="local", ) -TP962R_SERVICE_INFO_2 = BluetoothServiceInfo( +TP962R_SERVICE_INFO_2 = make_bluetooth_service_info( name="TP962R (0000)", manufacturer_data={17152: b"\x00\x17\nC\x00", 14081: b"\x00;\x0b7\x00"}, service_uuids=["72fbb631-6f6b-d1ba-db55-2ee6fdd942bd"],