Fixed statuses

main
parent d1e0a4646b
commit 2e3f19b156

@ -50,13 +50,15 @@ def getData():
jsondata=requests.get(fullurl, verify=False).json() jsondata=requests.get(fullurl, verify=False).json()
jsondatatwo=requests.get(fullurltwo, verify=False).json() jsondatatwo=requests.get(fullurltwo, verify=False).json()
state="" state=""
if jsondatatwo["state"]["flags"]["paused"] == "true": if jsondatatwo["state"]["flags"]["paused"]:
state="paused" state="paused"
elif jsondatatwo["state"]["flags"]["printing"] == "true": elif jsondatatwo["state"]["flags"]["printing"]:
state="printing" state="printing"
elif jsondatatwo["state"]["flags"]["error"] == "true": elif jsondatatwo["state"]["flags"]["error"]:
state="error" state="error"
elif jsondatatwo["state"]["flags"]["cancelling"] == "true": elif jsondatatwo["state"]["flags"]["ready"]:
state="ready"
elif jsondatatwo["state"]["flags"]["cancelling"]:
state="cancelling" state="cancelling"
else: else:
state="unknown" state="unknown"
@ -127,7 +129,7 @@ try:
draw.text((280,82),"Job complete.",font=font14,fill=0) draw.text((280,82),"Job complete.",font=font14,fill=0)
draw.text((250,96)," Refreshing every 5m.",font=font14,fill=0) draw.text((250,96)," Refreshing every 5m.",font=font14,fill=0)
else: else:
draw.text((280,82),jobdata["state"],font=font18,fill=0) draw.text((288,82),jobdata["state"],font=font18,fill=0)
draw.text((25,228),f"{jobdata['bedtemp']}°c/{jobdata['bedtarget']}°c {jobdata['temp']}°c/{jobdata['target']}°c",font=font14,fill=0) draw.text((25,228),f"{jobdata['bedtemp']}°c/{jobdata['bedtarget']}°c {jobdata['temp']}°c/{jobdata['target']}°c",font=font14,fill=0)
# DISPLAY OUR MASTERPIECE # DISPLAY OUR MASTERPIECE
epd.display(epd.getbuffer(paper)) epd.display(epd.getbuffer(paper))

Loading…
Cancel
Save