async def handle_frame(self, frame):
if isinstance(frame, FrameCommandSendConfirmation) and frame.session_id == self.session_id:<EOL><INDENT>if frame.status == CommandSendConfirmationStatus.ACCEPTED:<EOL><INDENT>self.success = True<EOL><DEDENT>return not self.wait_for_completion<EOL><DEDENT>if isinstance(frame, FrameCommandRemainingTimeNotification) and frame.session_id == self.session_id:<EOL><INDENT>return False<EOL><DEDENT>if isinstance(frame, FrameCommandRunStatusNotification) and frame.session_id == self.session_id:<EOL><INDENT>return False<EOL><DEDENT>if isinstance(frame, FrameSessionFinishedNotification) and frame.session_id == self.session_id:<EOL><INDENT>return True<EOL><DEDENT>return False<EOL>
Handle incoming API frame, return True if this was the expected frame.