1 Commits

Author SHA1 Message Date
Ollo
3b3d194916 Search serial device, if not provided 2026-04-19 14:02:13 +02:00

View File

@@ -18,7 +18,15 @@ COMMAND_PREFIX = "ollpe"
mqtt_server=os.environ['MQTT_SERVER'] mqtt_server=os.environ['MQTT_SERVER']
mqtt_topic=os.environ['MQTT_TOPIC'] mqtt_topic=os.environ['MQTT_TOPIC']
# SERIAL Port # SERIAL Port
try:
serial_device=os.environ['SERIAL_DEVICE'] serial_device=os.environ['SERIAL_DEVICE']
except (KeyError):
# search serial device
for root, dirs, files in os.walk("/dev/serial/by-id/"):
for name in files:
abspath=os.path.join(root, name)
serial_device=abspath
# Logging # Logging
try: try: