Skip to content

Commit e3cdd87

Browse files
allenporterCopilot
andauthored
chore: Apply suggestions from code review
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent a490330 commit e3cdd87

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

roborock/devices/device_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ def device_creator(home_data: HomeData, device: HomeDataDevice, product: HomeDat
241241
model_part = product.model.split(".")[-1]
242242
if "ss" in model_part:
243243
raise UnsupportedDeviceError(
244-
f"Device {device.name} has unsupported version B01_{product.model.strip('.')[-1]}"
244+
f"Device {device.name} has unsupported version B01_{model_part}"
245245
)
246246
elif "sc" in model_part:
247247
# Q7 devices start with 'sc' in their model naming.

tests/devices/test_device_manager.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import pytest
1010

1111
from roborock.data import HomeData, UserData
12-
from roborock.data.containers import HomeDataDevice
1312
from roborock.devices.cache import InMemoryCache
1413
from roborock.devices.device import RoborockDevice
1514
from roborock.devices.device_manager import UserParams, create_device_manager, create_web_api_wrapper
@@ -365,7 +364,7 @@ async def test_diagnostics_collection(home_data: HomeData) -> None:
365364
await device_manager.close()
366365

367366

368-
async def test_unsupported_protocol_versio() -> None:
367+
async def test_unsupported_protocol_version() -> None:
369368
"""Test the DeviceManager with some supported and unsupported product IDs."""
370369
with patch("roborock.devices.device_manager.UserWebApiClient.get_home_data") as mock_home_data:
371370
home_data = HomeData.from_dict({
@@ -405,7 +404,6 @@ async def test_unsupported_protocol_versio() -> None:
405404
mock_home_data.return_value = home_data
406405

407406
device_manager = await create_device_manager(USER_PARAMS)
408-
409407
# Only the supported device should be created. The other device is ignored
410408
devices = await device_manager.get_devices()
411409
assert [device.duid for device in devices] == ["device-uid-1"]

0 commit comments

Comments
 (0)