aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras/display/display.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2018-09-25 20:51:51 -0400
committerKevin O'Connor <kevin@koconnor.net>2018-09-25 20:51:51 -0400
commit170b9678fba2749063023008f51ebdff7e0e0759 (patch)
tree253ec42bc03383b07eb160b14b81c743564db38b /klippy/extras/display/display.py
parent364faf497bc0db92ee280acbbaa6fcdd2982d89f (diff)
downloadkutter-170b9678fba2749063023008f51ebdff7e0e0759.tar.gz
kutter-170b9678fba2749063023008f51ebdff7e0e0759.tar.xz
kutter-170b9678fba2749063023008f51ebdff7e0e0759.zip
display: Don't error on an out of range M73 request
No need to report an error if the M73 is not between 0 and 100 - just display the nearest valid value. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/extras/display/display.py')
-rw-r--r--klippy/extras/display/display.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/klippy/extras/display/display.py b/klippy/extras/display/display.py
index 7e2bb223..951007f4 100644
--- a/klippy/extras/display/display.py
+++ b/klippy/extras/display/display.py
@@ -246,7 +246,7 @@ class PrinterLCD:
self.msg_time = msg_time
# print progress: M73 P<percent>
def cmd_M73(self, params):
- self.progress = self.gcode.get_int('P', params, minval=0, maxval=100)
+ self.progress = min(100., max(0., self.gcode.get_float('P', params)))
self.prg_time = M73_TIMEOUT
def cmd_M117(self, params):
if '#original' in params: