From 8a2bfb5c9bd24de1895a794c30e6437ced18a55e Mon Sep 17 00:00:00 2001 From: Ben Lye Date: Fri, 27 Feb 2026 22:40:34 +0000 Subject: [PATCH] hall_filament_width_sensor: Improve query outputs QUERY_FILAMENT_WIDTH - format the calculated width in mm to four decimal places. QUERY_FILAMENT_WIDTH_RAW - remove an extra space before the ADC1 value. Signed-off-by: Ben Lye ben@lye.co.nz --- klippy/extras/hall_filament_width_sensor.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/klippy/extras/hall_filament_width_sensor.py b/klippy/extras/hall_filament_width_sensor.py index 38828d160..68180a002 100644 --- a/klippy/extras/hall_filament_width_sensor.py +++ b/klippy/extras/hall_filament_width_sensor.py @@ -200,8 +200,7 @@ class HallFilamentWidthSensor: def cmd_M407(self, gcmd): response = "" if self.diameter > 0: - response += ("Filament dia (measured mm): " - + str(self.diameter)) + response += ("Filament dia (measured mm): %.4f" % (self.diameter)) else: response += "Filament NOT present" gcmd.respond_info(response) @@ -246,8 +245,7 @@ class HallFilamentWidthSensor: cmd_QUERY_RAW_FILAMENT_WIDTH_help = ( "Report the raw filament width sensor values") def cmd_Get_Raw_Values(self, gcmd): - response = "ADC1=" - response += (" "+str(self.lastFilamentWidthReading)) + response = "ADC1="+str(self.lastFilamentWidthReading) response += (" ADC2="+str(self.lastFilamentWidthReading2)) response += (" RAW="+ str(self.lastFilamentWidthReading