@@ -360,17 +360,20 @@ async def _handle_as_command_response(self, line: str) -> None:
360360 self .logger .debug (f"Current pending responses: { len (self ._pending_responses )} " )
361361 for pending in self ._pending_responses :
362362 try :
363- self .logger .debug (f"Checking pending response: { pending .payload } " )
364- if pending .response_pattern :
365- self .logger .debug (f"Testing pattern: { pending .response_pattern } " )
366- if pending .response_pattern .match (line ):
367- self .logger .debug (f"Matched response pattern for command: { pending .payload } " )
363+ self .logger .debug (f"Checking pending response for command: { pending .command .payload } . Line: { line .strip ()} " )
364+
365+ pattern = pending .command .response_pattern
366+ if pattern :
367+ self .logger .debug (f"Testing pattern: { pattern .pattern } " )
368+ if pattern .match (line ):
369+ self .logger .debug (f"Matched response pattern for command: { pending .command .payload } " )
368370 pending .future .set_result (line )
369371 self ._pending_responses .remove (pending )
370372 return
371- self .logger .debug (f"Testing direct match for: { pending .payload } " )
372- if line .startswith (pending .payload ):
373- self .logger .debug (f"Matched direct response for command: { pending .payload } " )
373+
374+ self .logger .debug (f"Testing direct match for: { pending .command .payload } " )
375+ if line .startswith (pending .command .payload ):
376+ self .logger .debug (f"Matched direct response for command: { pending .command .payload } " )
374377 pending .future .set_result (line )
375378 self ._pending_responses .remove (pending )
376379 return
0 commit comments