Commit 17e84364 authored by Guillaume Seguin's avatar Guillaume Seguin

Fix _listen_until_online to have the desired behavior

Before you sometimes had to connect twice to actually connect because the M105
was sent before the printer's Serial module actually became ready. Now when no
data is available to read on the Serial line a new M105 is sent until
connection is established.
parent 6f7ecce7
......@@ -138,7 +138,7 @@ class printcore():
self._send("M105")
while self._listen_can_continue():
line = self._readline()
if line == None:
if not line:
break
if line.startswith(tuple(self.greetings)) or line.startswith('ok'):
if self.onlinecb:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment