Skip to content

Commit c171ff8

Browse files
committed
fix: use strip not split
1 parent 52ee779 commit c171ff8

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

roborock/devices/device_manager.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -197,17 +197,15 @@ def device_creator(home_data: HomeData, device: HomeDataDevice, product: HomeDat
197197
trait = a01.create(product, channel)
198198
case DeviceVersion.B01:
199199
channel = create_mqtt_channel(user_data, mqtt_params, mqtt_session, device)
200-
if "ss" in product.model.strip(".")[-1]:
200+
if "ss" in product.model.split(".")[-1]:
201201
raise NotImplementedError(
202202
f"Device {device.name} has unsupported version B01_{product.model.strip('.')[-1]}"
203203
)
204-
elif "sc" in product.model.strip(".")[-1]:
204+
elif "sc" in product.model.split(".")[-1]:
205205
# Q7 devices start with 'sc' in their model naming.
206206
trait = b01.q7.create(channel)
207207
else:
208-
raise NotImplementedError(
209-
f"Device {device.name} has unsupported B01 model: {product.model}"
210-
)
208+
raise NotImplementedError(f"Device {device.name} has unsupported B01 model: {product.model}")
211209
case _:
212210
raise NotImplementedError(f"Device {device.name} has unsupported version {device.pv}")
213211
return RoborockDevice(device, product, channel, trait)

0 commit comments

Comments
 (0)