Don't try to update if there is no print time estimate
This commit is contained in:
parent
3c1afc7b73
commit
d81a17ef61
@ -18,7 +18,10 @@ def get_printer_job(calendar, printer):
|
|||||||
print(f"Failed to get current job for {printer['name']}: {e}")
|
print(f"Failed to get current job for {printer['name']}: {e}")
|
||||||
return
|
return
|
||||||
|
|
||||||
if current_job["state"] == "Printing":
|
if (
|
||||||
|
current_job["state"] == "Printing"
|
||||||
|
and current_job["progress"]["printTimeLeft"] is not None
|
||||||
|
):
|
||||||
now = datetime.utcnow()
|
now = datetime.utcnow()
|
||||||
start = now - timedelta(seconds=current_job["progress"]["printTime"])
|
start = now - timedelta(seconds=current_job["progress"]["printTime"])
|
||||||
estimated_end = now + timedelta(
|
estimated_end = now + timedelta(
|
||||||
|
Loading…
Reference in New Issue
Block a user