add profile to Usb() call

main
samerbam 1 year ago
parent a667777fe2
commit 227cca06d4

@ -48,7 +48,7 @@ class ThermalPrinter():
self.database = database
try:
# self.p = Usb(0x0416, 0x5011, 4, 0x81, 0x02) #initalize printer on raspberry pi
self.p = Usb(idVendor=0x0416, idProduct=0x5011, usb_args=None, timeout=4 , in_ep=0x81, out_ep=0x02)
self.p = Usb(idVendor=0x0416, idProduct=0x5011, usb_args=None, timeout=4 , in_ep=0x81, out_ep=0x02, profile="POS-5890")
# pass
except usb.core.NoBackendError as e:
print(e)
@ -77,7 +77,7 @@ class ThermalPrinter():
def print_sudoku(self):
self.p.close()
# self.p = Usb(0x0416, 0x5011, None, 4, 0x81, 0x02)
self.p = Usb(idVendor=0x0416, idProduct=0x5011, usb_args=None, timeout=4000 , in_ep=0x81, out_ep=0x02)
self.p = Usb(idVendor=0x0416, idProduct=0x5011, usb_args=None, timeout=4000 , in_ep=0x81, out_ep=0x02, profile="POS-5890")
convert_to_image(generate_sudoku())
self.p.image("sudoku.png")

Loading…
Cancel
Save