diff --git a/alune/config.py b/alune/config.py index d489e13..97e83c5 100644 --- a/alune/config.py +++ b/alune/config.py @@ -70,6 +70,16 @@ def _sanitize(self): self._sanitize_log_level() self._sanitize_game_mode() self._sanitize_traits() + self._sanitize_adb_port() + + def _sanitize_adb_port(self): + adb_port = self._config.get("adb_port", 5555) + try: + adb_port = int(adb_port) + except ValueError: + logger.warning(f"The configured adb port '{adb_port}' is not a number. Using 5555 instead.") + adb_port = 5555 + self._config["adb_port"] = adb_port def _sanitize_log_level(self): """ diff --git a/alune/resources/config.yaml b/alune/resources/config.yaml index c94c3da..1829ae1 100644 --- a/alune/resources/config.yaml +++ b/alune/resources/config.yaml @@ -27,8 +27,12 @@ surrender_early: false # Default value : 0 (disabled = surrender as fast as possible) surrender_random_delay: 0 +# Override the default ADB port Alune tries to connect to. +# If there is no device listening on this port, a scan will happen to find your device. +adb_port: 5555 + # Changing these below values manually can potentially break the bot, so don't! # Version of the YAML. -version: 5 +version: 6 # Version of the TFT set. set: 12