diff --git a/klippy/extras/z_tilt.py b/klippy/extras/z_tilt.py index f8a8c718..72c33831 100644 --- a/klippy/extras/z_tilt.py +++ b/klippy/extras/z_tilt.py @@ -127,15 +127,8 @@ class RetryHelper: class ZTilt: def __init__(self, config): self.printer = config.get_printer() - z_positions = config.get('z_positions').split('\n') - try: - z_positions = [line.split(',', 1) - for line in z_positions if line.strip()] - self.z_positions = [(float(zp[0].strip()), float(zp[1].strip())) - for zp in z_positions] - except: - raise config.error("Unable to parse z_positions in %s" % ( - config.get_name())) + self.z_positions = config.getlists('z_positions', seps=(',', '\n'), + parser=float, count=2) self.retry_helper = RetryHelper(config) self.probe_helper = probe.ProbePointsHelper(config, self.probe_finalize) self.probe_helper.minimum_points(2)