@@ -32,7 +32,7 @@ def __find_remote_device_controller(self) -> str:
3232 return f"{ os .environ ['ASKUI_INSTALLATION_DIRECTORY' ]} /Binaries/resources/assets/binaries/AskuiRemoteDeviceController"
3333
3434 def __start_process (self , path ):
35- self .process = subprocess .Popen (path )
35+ self .process = subprocess .Popen ([ path , "--debugDraw" , "true" ] )
3636 wait_for_port (23000 )
3737
3838 def start (self , clean_up = False ):
@@ -54,13 +54,14 @@ def stop(self, force=False):
5454
5555
5656class AskUiControllerClient ():
57- def __init__ (self ) -> None :
57+ def __init__ (self , display : int = 1 ) -> None :
5858 self .stub = None
5959 self .channel = None
6060 self .session_info = None
6161 self .pre_action_wait = 0
6262 self .post_action_wait = 0.05
6363 self .max_retries = 10
64+ self .display = display
6465
6566 def connect (self ):
6667 self .channel = grpc .insecure_channel ('localhost:23000' , options = [
@@ -103,8 +104,8 @@ def __start_execution(self):
103104 def __stop_execution (self ):
104105 self .stub .StopExecution (controller_v1_pbs .Request_StopExecution (sessionInfo = self .session_info ))
105106
106- def screenshot (self , display = 1 ) -> Image :
107- screenResponse = self .stub .CaptureScreen (controller_v1_pbs .Request_CaptureScreen (sessionInfo = self .session_info , captureParameters = controller_v1_pbs .CaptureParameters (displayID = display )))
107+ def screenshot (self ) -> Image :
108+ screenResponse = self .stub .CaptureScreen (controller_v1_pbs .Request_CaptureScreen (sessionInfo = self .session_info , captureParameters = controller_v1_pbs .CaptureParameters (displayID = self . display )))
108109 r , g , b , _ = Image .frombytes ('RGBA' , (screenResponse .bitmap .width , screenResponse .bitmap .height ), screenResponse .bitmap .data ).split ()
109110 image = Image .merge ("RGB" , (b , g , r ))
110111 return image
@@ -165,3 +166,4 @@ def keyboard_tap(self, key: str, modifierKeys: List[str] = None):
165166
166167 def set_display (self , displayNumber : int = 1 ):
167168 self .stub .SetActiveDisplay (controller_v1_pbs .Request_SetActiveDisplay (displayID = displayNumber ))
169+ self .display = displayNumber
0 commit comments