1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-27 03:48:21 +08:00

Fix: Connecting device over http

This commit is contained in:
LmeSzinc
2022-09-30 12:18:25 +08:00
parent 8653f07e1c
commit b161f14532
2 changed files with 4 additions and 3 deletions

View File

@@ -80,7 +80,8 @@ class Connection(ConnectionAttr):
config (AzurLaneConfig, str): Name of the user config under ./config config (AzurLaneConfig, str): Name of the user config under ./config
""" """
super().__init__(config) super().__init__(config)
self.detect_device() if not self.is_over_http:
self.detect_device()
# Connect # Connect
self.adb_connect(self.serial) self.adb_connect(self.serial)

View File

@@ -87,11 +87,11 @@ class ConnectionAttr:
self.config.Emulator_ScreenshotMethod = 'uiautomator2' self.config.Emulator_ScreenshotMethod = 'uiautomator2'
self.config.Emulator_ControlMethod = 'uiautomator2' self.config.Emulator_ControlMethod = 'uiautomator2'
if self.is_over_http: if self.is_over_http:
if self.config.Emulator_ScreenshotMethod not in ["ADB", "uiautomator2"] \ if self.config.Emulator_ScreenshotMethod not in ["ADB", "uiautomator2", "aScreenCap"] \
or self.config.Emulator_ControlMethod not in ["ADB", "uiautomator2", "minitouch"]: or self.config.Emulator_ControlMethod not in ["ADB", "uiautomator2", "minitouch"]:
logger.warning( logger.warning(
f'When connecting to a device over http: {self.serial} ' f'When connecting to a device over http: {self.serial} '
f'ScreenshotMethod can only use ["ADB", "uiautomator2"], ' f'ScreenshotMethod can only use ["ADB", "uiautomator2", "aScreenCap"], '
f'ControlMethod can only use ["ADB", "uiautomator2", "minitouch"]' f'ControlMethod can only use ["ADB", "uiautomator2", "minitouch"]'
) )
raise RequestHumanTakeover raise RequestHumanTakeover