Interpret wait during connect fully as ok

Otherwise we might switch to connected state but lack an
acknowledgement to send the next lines and stay in a wait cycle.

Also related to #1770
This commit is contained in:
Gina Häußge 2017-02-20 12:44:24 +01:00
parent 7f0eb8d895
commit 9f963696c8

View file

@ -1384,6 +1384,9 @@ class MachineCom(object):
startSeen = True
self.sayHello()
elif line.startswith("ok") or (supportWait and line == "wait"):
if line == "wait":
# if it was a wait we probably missed an ok, so let's simulate that now
self._handle_ok()
self._onConnected()
elif time.time() > self._timeout:
self._log("There was a timeout while trying to connect to the printer")