5050from roborock .devices .device import RoborockDevice
5151from roborock .devices .device_manager import DeviceManager , UserParams , create_device_manager
5252from roborock .devices .traits import Trait
53+ from roborock .devices .traits .b01 .q10 .vacuum import VacuumTrait
5354from roborock .devices .traits .v1 import V1TraitMixin
5455from roborock .devices .traits .v1 .consumeable import ConsumableAttribute
5556from roborock .devices .traits .v1 .map_content import MapContentTrait
@@ -438,7 +439,7 @@ async def _display_v1_trait(context: RoborockContext, device_id: str, display_fu
438439 click .echo (dump_json (trait .as_dict ()))
439440
440441
441- async def _q10_vacuum_trait (context : RoborockContext , device_id : str ):
442+ async def _q10_vacuum_trait (context : RoborockContext , device_id : str ) -> VacuumTrait :
442443 """Get VacuumTrait from Q10 device."""
443444 device_manager = await context .get_device_manager ()
444445 device = await device_manager .get_device (device_id )
@@ -1150,11 +1151,11 @@ def write_markdown_table(product_features: dict[str, dict[str, any]], all_featur
11501151 click .echo ("Done." )
11511152
11521153
1153- @click .command ()
1154+ @session .command ()
11541155@click .option ("--device_id" , required = True , help = "Device ID" )
11551156@click .pass_context
11561157@async_command
1157- async def q10_vacuum_start (ctx , device_id ) :
1158+ async def q10_vacuum_start (ctx : click . Context , device_id : str ) -> None :
11581159 """Start vacuum cleaning on Q10 device."""
11591160 context : RoborockContext = ctx .obj
11601161 try :
@@ -1167,11 +1168,11 @@ async def q10_vacuum_start(ctx, device_id):
11671168 click .echo (f"Error: { e } " )
11681169
11691170
1170- @click .command ()
1171+ @session .command ()
11711172@click .option ("--device_id" , required = True , help = "Device ID" )
11721173@click .pass_context
11731174@async_command
1174- async def q10_vacuum_pause (ctx , device_id ) :
1175+ async def q10_vacuum_pause (ctx : click . Context , device_id : str ) -> None :
11751176 """Pause vacuum cleaning on Q10 device."""
11761177 context : RoborockContext = ctx .obj
11771178 try :
@@ -1184,11 +1185,11 @@ async def q10_vacuum_pause(ctx, device_id):
11841185 click .echo (f"Error: { e } " )
11851186
11861187
1187- @click .command ()
1188+ @session .command ()
11881189@click .option ("--device_id" , required = True , help = "Device ID" )
11891190@click .pass_context
11901191@async_command
1191- async def q10_vacuum_resume (ctx , device_id ) :
1192+ async def q10_vacuum_resume (ctx : click . Context , device_id : str ) -> None :
11921193 """Resume vacuum cleaning on Q10 device."""
11931194 context : RoborockContext = ctx .obj
11941195 try :
@@ -1201,11 +1202,11 @@ async def q10_vacuum_resume(ctx, device_id):
12011202 click .echo (f"Error: { e } " )
12021203
12031204
1204- @click .command ()
1205+ @session .command ()
12051206@click .option ("--device_id" , required = True , help = "Device ID" )
12061207@click .pass_context
12071208@async_command
1208- async def q10_vacuum_stop (ctx , device_id ) :
1209+ async def q10_vacuum_stop (ctx : click . Context , device_id : str ) -> None :
12091210 """Stop vacuum cleaning on Q10 device."""
12101211 context : RoborockContext = ctx .obj
12111212 try :
@@ -1218,11 +1219,11 @@ async def q10_vacuum_stop(ctx, device_id):
12181219 click .echo (f"Error: { e } " )
12191220
12201221
1221- @click .command ()
1222+ @session .command ()
12221223@click .option ("--device_id" , required = True , help = "Device ID" )
12231224@click .pass_context
12241225@async_command
1225- async def q10_vacuum_dock (ctx , device_id ) :
1226+ async def q10_vacuum_dock (ctx : click . Context , device_id : str ) -> None :
12261227 """Return vacuum to dock on Q10 device."""
12271228 context : RoborockContext = ctx .obj
12281229 try :
0 commit comments