From 170b9678fba2749063023008f51ebdff7e0e0759 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Tue, 25 Sep 2018 20:51:51 -0400 Subject: [PATCH] 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 --- klippy/extras/display/display.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 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: