Don't try to update if there is no print time estimate

This commit is contained in:
Adam Goldsmith 2022-04-02 18:58:21 -04:00
parent 3c1afc7b73
commit d81a17ef61

View File

@ -18,7 +18,10 @@ def get_printer_job(calendar, printer):
print(f"Failed to get current job for {printer['name']}: {e}")
return
if current_job["state"] == "Printing":
if (
current_job["state"] == "Printing"
and current_job["progress"]["printTimeLeft"] is not None
):
now = datetime.utcnow()
start = now - timedelta(seconds=current_job["progress"]["printTime"])
estimated_end = now + timedelta(