Skip to content

Commit 66d6929

Browse files
Fix printer handling
1 parent a1f5390 commit 66d6929

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

main.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@
1717
logger = logging.getLogger('uvicorn.error')
1818
lock = threading.Lock()
1919

20-
printer.init_printer(bytes.fromhex(config['printer']['maj']), bytes.fromhex(config['printer']['min']))
20+
printer.init_printer(
21+
int(config['printer']['maj'], 16),
22+
int(config['printer']['min'], 16)
23+
)
2124

2225
app = FastAPI()
2326

printer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
p = Dummy()
66

7-
def init_printer(maj: bytes, min: bytes):
7+
def init_printer(maj: int, min: int):
88
global p
99
p = Usb(maj, min, 0, profile="TM-P80")
1010

0 commit comments

Comments
 (0)