Base web UI port number off bot name

This commit is contained in:
Tanner committed 2026-11-09 04:24:39 +00:00
1 parent b2bf939c74
commit 243e34e26f
2 files changed
+17 -1

No files matched your search

+7 -1
View File
@@ -1,5 +1,6 @@
import importlib
import json
import os
import queue
import re
import urllib.error
@@ -522,9 +523,14 @@ def main():
observer.join()
worker.join(timeout=2.0)
def web_port_for_player(name):
suffix = str(name or '')[-1:]
return 3300 + int(suffix) if suffix in tuple('123456789') else 3300
def run_api():
host = '0.0.0.0'
port = 3300
port = web_port_for_player(os.environ.get('PLAYER_NAME', 'mosfet1'))
while True:
print('Trying to run web interface on port:', port)