Merge pull request #2337 from kantlivelong/autoconnect_fix

BUGFIX: Fix autoconnect on start so that it works with the port set to AUTO (#2311)
This commit is contained in:
Gina Häußge authored and GitHub committed 2018-01-12 15:35:50 +01:00
commit c11288ff65
1 file changed
+1 -1
+1 -1
View File
@@ -608,7 +608,7 @@ class Server(object):
(port, baudrate) = self._settings.get(["serial", "port"]), self._settings.getInt(["serial", "baudrate"])
printer_profile = printerProfileManager.get_default()
connectionOptions = printer.__class__.get_connection_options()
if port in connectionOptions["ports"]:
if port in connectionOptions["ports"] or port == "AUTO":
printer.connect(port=port, baudrate=baudrate, profile=printer_profile["id"] if "id" in printer_profile else "_default")
except:
self._logger.exception("Something went wrong while attempting to automatically connect to the printer")