nothing works, shits broken

This commit is contained in:
2025-10-02 22:43:24 +03:00
parent 8c1647eb13
commit f85d3352b0
6 changed files with 129 additions and 52 deletions

View File

@@ -1,17 +1,24 @@
from escpos.printer import Network
class Printer:
def __init__(self, address: str, port: int = 9070, profile="RP-F10-80mm"):
def __init__(self, address: str, port: int = 9070,
profile: str = "RP-F10-80mm"):
self.address = address
self.port = port
self.profile = profile
self.printer = Network(host = self.address, port=self.port, profile=profile)
self.printer = Network(
host=self.address,
port=self.port,
profile=self.profile,
timeout=5,
)
def test_connection(self):
return self.printer.is_online()
def print_text(self, text: str):
# todo text properties via printer.set()
# todo web editor rich text to printer.set() properties
self.printer.text(text)
self.printer.ln(2)
self.printer.cut()