fix: Initialize printer hardware before each print
Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
1
main.py
1
main.py
@@ -22,6 +22,7 @@ PRINTER_WIDTH = 384 # Set to your printer's pixel width (common: 384 or 576)
|
|||||||
|
|
||||||
def print_picture(filename, p):
|
def print_picture(filename, p):
|
||||||
try:
|
try:
|
||||||
|
p.hw('INIT')
|
||||||
response = requests.get(STATIC_URL + filename, timeout=5)
|
response = requests.get(STATIC_URL + filename, timeout=5)
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user