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
This commit is contained in:
Ben Lye 2026-02-27 22:40:34 +00:00
parent 393fc453de
commit 8a2bfb5c9b

View file

@ -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