diff --git a/homeassistant/components/sensorpush/manifest.json b/homeassistant/components/sensorpush/manifest.json index 7729a67d7a1..52712a0cc86 100644 --- a/homeassistant/components/sensorpush/manifest.json +++ b/homeassistant/components/sensorpush/manifest.json @@ -17,5 +17,5 @@ "dependencies": ["bluetooth_adapters"], "documentation": "https://www.home-assistant.io/integrations/sensorpush", "iot_class": "local_push", - "requirements": ["sensorpush-ble==1.7.1"] + "requirements": ["sensorpush-ble==1.8.0"] } diff --git a/requirements_all.txt b/requirements_all.txt index 31038542629..96fe8768620 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -2725,7 +2725,7 @@ sensorpro-ble==0.5.3 sensorpush-api==2.1.2 # homeassistant.components.sensorpush -sensorpush-ble==1.7.1 +sensorpush-ble==1.8.0 # homeassistant.components.sensorpush_cloud sensorpush-ha==1.3.2 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index a09d151a3e3..1d5f0d9b5c7 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -2205,7 +2205,7 @@ sensorpro-ble==0.5.3 sensorpush-api==2.1.2 # homeassistant.components.sensorpush -sensorpush-ble==1.7.1 +sensorpush-ble==1.8.0 # homeassistant.components.sensorpush_cloud sensorpush-ha==1.3.2 diff --git a/tests/components/sensorpush/__init__.py b/tests/components/sensorpush/__init__.py index aae960970dd..88fb2072961 100644 --- a/tests/components/sensorpush/__init__.py +++ b/tests/components/sensorpush/__init__.py @@ -1,8 +1,48 @@ """Tests for the SensorPush integration.""" -from homeassistant.helpers.service_info.bluetooth import BluetoothServiceInfo +from uuid import UUID -NOT_SENSOR_PUSH_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_SENSOR_PUSH_SERVICE_INFO = make_bluetooth_service_info( name="Not it", address="61DE521B-F0BF-9F44-64D4-75BBE1738105", rssi=-63, @@ -12,7 +52,7 @@ NOT_SENSOR_PUSH_SERVICE_INFO = BluetoothServiceInfo( source="local", ) -HTW_SERVICE_INFO = BluetoothServiceInfo( +HTW_SERVICE_INFO = make_bluetooth_service_info( name="SensorPush HT.w 0CA1", address="61DE521B-F0BF-9F44-64D4-75BBE1738105", rssi=-63, @@ -22,7 +62,7 @@ HTW_SERVICE_INFO = BluetoothServiceInfo( source="local", ) -HTPWX_SERVICE_INFO = BluetoothServiceInfo( +HTPWX_SERVICE_INFO = make_bluetooth_service_info( name="SensorPush HTP.xw F4D", address="4125DDBA-2774-4851-9889-6AADDD4CAC3D", rssi=-56, @@ -33,7 +73,7 @@ HTPWX_SERVICE_INFO = BluetoothServiceInfo( ) -HTPWX_EMPTY_SERVICE_INFO = BluetoothServiceInfo( +HTPWX_EMPTY_SERVICE_INFO = make_bluetooth_service_info( name="SensorPush HTP.xw F4D", address="4125DDBA-2774-4851-9889-6AADDD4CAC3D", rssi=-56,