Skip to content

Commit

Permalink
re-enable adb port configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
akshualy committed Oct 19, 2024
1 parent 40f67fd commit 63258c4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
10 changes: 10 additions & 0 deletions alune/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down
6 changes: 5 additions & 1 deletion alune/resources/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 63258c4

Please sign in to comment.