@@ -1158,9 +1158,14 @@ def write_markdown_table(product_features: dict[str, dict[str, any]], all_featur
11581158async def q10_vacuum_start (ctx , device_id ):
11591159 """Start vacuum cleaning on Q10 device."""
11601160 context : RoborockContext = ctx .obj
1161- trait = await _q10_vacuum_trait (context , device_id )
1162- await trait .start_clean ()
1163- click .echo ("Starting vacuum cleaning..." )
1161+ try :
1162+ trait = await _q10_vacuum_trait (context , device_id )
1163+ await trait .start_clean ()
1164+ click .echo ("Starting vacuum cleaning..." )
1165+ except RoborockUnsupportedFeature :
1166+ click .echo ("Device does not have VacuumTrait. Is it a Q10?" )
1167+ except RoborockException as e :
1168+ click .echo (f"Error: { e } " )
11641169
11651170
11661171@click .command ()
@@ -1170,9 +1175,14 @@ async def q10_vacuum_start(ctx, device_id):
11701175async def q10_vacuum_pause (ctx , device_id ):
11711176 """Pause vacuum cleaning on Q10 device."""
11721177 context : RoborockContext = ctx .obj
1173- trait = await _q10_vacuum_trait (context , device_id )
1174- await trait .pause_clean ()
1175- click .echo ("Pausing vacuum cleaning..." )
1178+ try :
1179+ trait = await _q10_vacuum_trait (context , device_id )
1180+ await trait .pause_clean ()
1181+ click .echo ("Pausing vacuum cleaning..." )
1182+ except RoborockUnsupportedFeature :
1183+ click .echo ("Device does not have VacuumTrait. Is it a Q10?" )
1184+ except RoborockException as e :
1185+ click .echo (f"Error: { e } " )
11761186
11771187
11781188@click .command ()
@@ -1182,9 +1192,14 @@ async def q10_vacuum_pause(ctx, device_id):
11821192async def q10_vacuum_resume (ctx , device_id ):
11831193 """Resume vacuum cleaning on Q10 device."""
11841194 context : RoborockContext = ctx .obj
1185- trait = await _q10_vacuum_trait (context , device_id )
1186- await trait .resume_clean ()
1187- click .echo ("Resuming vacuum cleaning..." )
1195+ try :
1196+ trait = await _q10_vacuum_trait (context , device_id )
1197+ await trait .resume_clean ()
1198+ click .echo ("Resuming vacuum cleaning..." )
1199+ except RoborockUnsupportedFeature :
1200+ click .echo ("Device does not have VacuumTrait. Is it a Q10?" )
1201+ except RoborockException as e :
1202+ click .echo (f"Error: { e } " )
11881203
11891204
11901205@click .command ()
@@ -1194,9 +1209,14 @@ async def q10_vacuum_resume(ctx, device_id):
11941209async def q10_vacuum_stop (ctx , device_id ):
11951210 """Stop vacuum cleaning on Q10 device."""
11961211 context : RoborockContext = ctx .obj
1197- trait = await _q10_vacuum_trait (context , device_id )
1198- await trait .stop_clean ()
1199- click .echo ("Stopping vacuum cleaning..." )
1212+ try :
1213+ trait = await _q10_vacuum_trait (context , device_id )
1214+ await trait .stop_clean ()
1215+ click .echo ("Stopping vacuum cleaning..." )
1216+ except RoborockUnsupportedFeature :
1217+ click .echo ("Device does not have VacuumTrait. Is it a Q10?" )
1218+ except RoborockException as e :
1219+ click .echo (f"Error: { e } " )
12001220
12011221
12021222@click .command ()
@@ -1206,9 +1226,14 @@ async def q10_vacuum_stop(ctx, device_id):
12061226async def q10_vacuum_dock (ctx , device_id ):
12071227 """Return vacuum to dock on Q10 device."""
12081228 context : RoborockContext = ctx .obj
1209- trait = await _q10_vacuum_trait (context , device_id )
1210- await trait .return_to_dock ()
1211- click .echo ("Returning vacuum to dock..." )
1229+ try :
1230+ trait = await _q10_vacuum_trait (context , device_id )
1231+ await trait .return_to_dock ()
1232+ click .echo ("Returning vacuum to dock..." )
1233+ except RoborockUnsupportedFeature :
1234+ click .echo ("Device does not have VacuumTrait. Is it a Q10?" )
1235+ except RoborockException as e :
1236+ click .echo (f"Error: { e } " )
12121237
12131238
12141239cli .add_command (login )
0 commit comments