Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-enable adb port configuration #69

Merged
merged 1 commit into from
Oct 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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