Use assignment expressions 30 (#58714)

This commit is contained in:
Marc Mueller 2021-10-30 16:33:42 +02:00 committed by GitHub
parent 7063c05127
commit 84618fa831
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 33 additions and 77 deletions

View file

@ -130,8 +130,7 @@ class OctoPrintJobPercentageSensor(OctoPrintSensorBase):
if not job:
return None
state = job.progress.completion
if not state:
if not (state := job.progress.completion):
return 0
return round(state, 2)