fix possible issue with the mesh profile is not complete

This commit is contained in:
alfrix 2023-07-07 22:57:46 -03:00
parent f9af11d635
commit d6b700381b

View File

@ -74,6 +74,7 @@ class Printer:
if x.startswith('output_pin ') and not x.split()[1].startswith("_"):
self.output_pin_count += 1
if x.startswith('bed_mesh '):
try:
r = self.config[x]
r['x_count'] = int(r['x_count'])
r['y_count'] = int(r['y_count'])
@ -82,6 +83,8 @@ class Printer:
r['max_y'] = float(r['max_y'])
r['min_y'] = float(r['min_y'])
r['points'] = [[float(j.strip()) for j in i.split(",")] for i in r['points'].strip().split("\n")]
except KeyError:
logging.debug(f"Couldn't load mesh {x}: {self.config[x]}")
self.process_update(data)
logging.info(f"Klipper version: {printer_info['software_version']}")