initial prototype for autokanban
This commit is contained in:
commit
e03b3014fe
5647 changed files with 345269 additions and 0 deletions
16
app/printer.py
Normal file
16
app/printer.py
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import escpos.printer
|
||||
|
||||
# Update this to match your printer's device path
|
||||
PRINTER_DEVICE = "/dev/ttyUSB0"
|
||||
|
||||
class KanbanPrinter:
|
||||
def __init__(self, device=PRINTER_DEVICE):
|
||||
self.device = device
|
||||
|
||||
def print_task(self, content: str):
|
||||
try:
|
||||
printer = escpos.printer.Serial(devfile=self.device, baudrate=19200, timeout=1)
|
||||
printer.text(f"Task: {content}\n")
|
||||
printer.cut()
|
||||
except Exception as e:
|
||||
print(f"Printer error: {e}")
|
||||
Loading…
Add table
Add a link
Reference in a new issue