From: Edward Betts Date: Tue, 8 Jul 2025 11:00:00 +0200 Subject: Fix tests for new Bleak API --- tests/test_models.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/test_models.py b/tests/test_models.py index b8001f2..3f66bde 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -42,7 +42,7 @@ def test_model(): def test_model_from_bleak(): - switchbot_device = BLEDevice("44:44:33:11:23:45", "wohand", {}, -127) + switchbot_device = BLEDevice("44:44:33:11:23:45", "wohand", {}) switchbot_adv = generate_advertisement_data( local_name="wohand", service_uuids=["cba20d00-224d-11e6-9fb8-0002a5d5c51b"] ) @@ -58,7 +58,7 @@ def test_model_from_bleak(): def test_model_from_scanner(): - switchbot_device = BLEDevice("44:44:33:11:23:45", "wohand", {}, -127) + switchbot_device = BLEDevice("44:44:33:11:23:45", "wohand", {}) switchbot_adv = generate_advertisement_data( local_name="wohand", service_uuids=["cba20d00-224d-11e6-9fb8-0002a5d5c51b"] ) @@ -83,6 +83,7 @@ def test_model_from_scanner(): "connectable": True, "manufacturer_data": {}, "name": "wohand", + "raw": None, "rssi": -127, "service_data": {}, "service_uuids": ["cba20d00-224d-11e6-9fb8-0002a5d5c51b"], @@ -93,7 +94,7 @@ def test_model_from_scanner(): def test_construct_service_info_bleak(): - switchbot_device = BLEDevice("44:44:33:11:23:45", "wohand", {}, -127) + switchbot_device = BLEDevice("44:44:33:11:23:45", "wohand", {}) switchbot_adv = generate_advertisement_data( local_name="wohand", service_uuids=["cba20d00-224d-11e6-9fb8-0002a5d5c51b"] ) @@ -129,6 +130,7 @@ def test_construct_service_info_bleak(): "connectable": False, "manufacturer_data": {}, "name": "wohand", + "raw": None, "rssi": -127, "service_data": {}, "service_uuids": ["cba20d00-224d-11e6-9fb8-0002a5d5c51b"], @@ -140,7 +142,7 @@ def test_construct_service_info_bleak(): def test_from_device_and_advertisement_data(): """Test creating a BluetoothServiceInfoBleak from a BLEDevice and AdvertisementData.""" - switchbot_device = BLEDevice("44:44:33:11:23:45", "wohand", {}, -127) + switchbot_device = BLEDevice("44:44:33:11:23:45", "wohand", {}) switchbot_adv = generate_advertisement_data( local_name="wohand", service_uuids=["cba20d00-224d-11e6-9fb8-0002a5d5c51b"] ) @@ -163,6 +165,7 @@ def test_from_device_and_advertisement_data(): "connectable": True, "manufacturer_data": {}, "name": "wohand", + "raw": None, "rssi": -127, "service_data": {}, "service_uuids": ["cba20d00-224d-11e6-9fb8-0002a5d5c51b"], @@ -187,7 +190,7 @@ def test_pyobjc_compat(): assert address == "44:44:33:11:23:45" assert rssi == -127 - switchbot_device = BLEDevice(address, name, {}, rssi) + switchbot_device = BLEDevice(address, name, {}) switchbot_adv = generate_advertisement_data( local_name=name, service_uuids=["cba20d00-224d-11e6-9fb8-0002a5d5c51b"] ) @@ -223,6 +226,7 @@ def test_pyobjc_compat(): "connectable": False, "manufacturer_data": {}, "name": "wohand", + "raw": None, "rssi": -127, "service_data": {}, "service_uuids": ["cba20d00-224d-11e6-9fb8-0002a5d5c51b"],