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.
master
Guillaume Seguin 2012-08-07 08:39:09 +02:00
parent 6f7ecce7ff
commit 17e8436436
1 changed files with 1 additions and 1 deletions

View File

@ -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: