@@ -73,11 +73,12 @@ def on_disconnect(_):
7373 disconnect_event .set ()
7474
7575 # long timeout in case pairing is needed
76- async with asyncio .timeout (60 ), BleakClient (
77- device , on_disconnect
78- ) as client , OADImageIdentify (client ) as image_identify , OADControlPoint (
79- client
80- ) as control_point :
76+ async with (
77+ asyncio .timeout (60 ),
78+ BleakClient (device , on_disconnect ) as client ,
79+ OADImageIdentify (client ) as image_identify ,
80+ OADControlPoint (client ) as control_point ,
81+ ):
8182 image_block = OADImageBlock (client )
8283
8384 print (f"Connected to { device .name } " )
@@ -107,9 +108,10 @@ def on_disconnect(_):
107108
108109 print ("Flashing..." )
109110
110- with logging_redirect_tqdm (), tqdm (
111- total = header .image_length , unit = "B" , unit_scale = True
112- ) as pbar :
111+ with (
112+ logging_redirect_tqdm (),
113+ tqdm (total = header .image_length , unit = "B" , unit_scale = True ) as pbar ,
114+ ):
113115 async with asyncio .TaskGroup () as group :
114116 try :
115117 async for (
@@ -161,9 +163,11 @@ async def dump_oad_info():
161163 return
162164
163165 # long timeout in case pairing is needed
164- async with asyncio .timeout (30 ), BleakClient (device ) as client , OADControlPoint (
165- client
166- ) as control_point :
166+ async with (
167+ asyncio .timeout (30 ),
168+ BleakClient (device ) as client ,
169+ OADControlPoint (client ) as control_point ,
170+ ):
167171 sw_ver = await control_point .get_software_version ()
168172 print (
169173 f"Software version: app={ sw_ver .app .major } .{ sw_ver .app .minor } , stack={ sw_ver .stack .major } .{ sw_ver .stack .minor } "
0 commit comments