diff --git a/app/main.py b/app/main.py index a3391f9..11f566e 100644 --- a/app/main.py +++ b/app/main.py @@ -243,8 +243,12 @@ def print_task(request: Request, task_id: str): print(f"[DEBUG] Attempting to print to {PRINTER_DEVICE} at {PRINTER_BAUDRATE} baud...") try: printer = escpos.printer.Serial(devfile=PRINTER_DEVICE, baudrate=PRINTER_BAUDRATE, timeout=1) - printer.text(f"Task: {task.content}\nVon: {task.user}\nPriorität: {task.priority}\n") + + # Print the formatted image instead of plain text + printer.image(img) + printer.text("\n\n") # Add some spacing after image printer.cut() + print(f"[DEBUG] Print command sent successfully") except Exception as print_err: print(f"[ERROR] Printer failed: {print_err}")