fix return type of cups.py

This commit is contained in:
Alexandre Detiste 2023-12-13 21:18:15 +01:00
parent 56cabcedd7
commit a8e38bed9a

View File

@ -199,7 +199,7 @@ class CupsPrinter(Escpos):
self.tmpfile.close() self.tmpfile.close()
self.pending_job = False self.pending_job = False
def _read(self) -> List[int]: def _read(self) -> bytes:
"""Return a single-item array with the accepting state of the print queue. """Return a single-item array with the accepting state of the print queue.
states: idle = [3], printing a job = [4], stopped = [5] states: idle = [3], printing a job = [4], stopped = [5]
@ -207,8 +207,8 @@ class CupsPrinter(Escpos):
printer = self.printers.get(self.printer_name, {}) printer = self.printers.get(self.printer_name, {})
state = printer.get("printer-state") state = printer.get("printer-state")
if not state: if not state:
return [] return b''
return [state] return bytes((state,))
def close(self) -> None: def close(self) -> None:
"""Close CUPS connection. """Close CUPS connection.