Add support for QR code task

This commit is contained in:
n07070
2026-06-01 21:40:28 +02:00
parent 9e77e0980b
commit 9e4ec6c1a5

View File

@@ -30,6 +30,7 @@ class TaskType(Enum):
TEXT = "text"
IMAGE = "image"
CUT = "cut"
QR = "qr"
class PrintTask(ABC):
@@ -67,6 +68,15 @@ class TextTask(PrintTask):
def get_print_data(self):
return {"txt": self.content, "sign": self.signature}
class QRTask(TextTask):
"""This task prints a QR-Code, the signature is ignore and is always the content itself"""
def __init__(self, content):
super().__init__(content, signature="")
self.content = content
self.signature = content
def get_print_data(self):
return {"txt": self.content, "sign": self.signature}
class ImageTask(PrintTask):
"""