Syntax changes.

Change the value check syntax.
Change the offline array returned to use a constant.
This commit is contained in:
csoft2k 2017-07-23 11:35:12 +02:00
parent 05cd028ac6
commit 7e9cbf611a

View File

@ -747,13 +747,13 @@ class Escpos(object):
self._raw(RT_STATUS_ONLINE)
time.sleep(1)
status = self._read()
return status or [8]
return status or [RT_MASK_ONLINE]
def is_online(self):
""" Queries the printer its online status.
When online, returns True; False otherwise.
:rtype: bool: True if online, False if offline."""
return (self.query_status()[0] & RT_MASK_ONLINE) == 0
return not (self.query_status()[0] & RT_MASK_ONLINE)
class EscposIO(object):