fix: Initialize printer hardware before each print

Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
2025-12-09 21:13:21 -07:00
parent 56574b4c14
commit 6c0be6ed95

View File

@@ -22,6 +22,7 @@ PRINTER_WIDTH = 384 # Set to your printer's pixel width (common: 384 or 576)
def print_picture(filename, p):
try:
p.hw('INIT')
response = requests.get(STATIC_URL + filename, timeout=5)
response.raise_for_status()