safe_z_home: Use configfile note_valid=False when inspecting z position_max

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2020-12-13 10:28:53 -05:00
parent b25520795d
commit 14fd40e3f9
1 changed files with 5 additions and 5 deletions

View File

@ -8,16 +8,16 @@ class SafeZHoming:
def __init__(self, config): def __init__(self, config):
self.printer = config.get_printer() self.printer = config.get_printer()
try: try:
x_pos, y_pos = config.get("home_xy_position", x_pos, y_pos = config.get("home_xy_position").split(',')
default=",").split(',')
self.home_x_pos, self.home_y_pos = float(x_pos), float(y_pos) self.home_x_pos, self.home_y_pos = float(x_pos), float(y_pos)
except: except:
raise config.error("Unable to parse home_xy_position in %s" % ( raise config.error("Unable to parse home_xy_position in %s"
config.get_name())) % (config.get_name(),))
self.z_hop = config.getfloat("z_hop", default=0.0) self.z_hop = config.getfloat("z_hop", default=0.0)
self.z_hop_speed = config.getfloat('z_hop_speed', 15., above=0.) self.z_hop_speed = config.getfloat('z_hop_speed', 15., above=0.)
self.max_z = config.getsection('stepper_z').getfloat('position_max') zconfig = config.getsection('stepper_z')
self.max_z = zconfig.getfloat('position_max', note_valid=False)
self.speed = config.getfloat('speed', 50.0, above=0.) self.speed = config.getfloat('speed', 50.0, above=0.)
self.move_to_previous = config.getboolean('move_to_previous', False) self.move_to_previous = config.getboolean('move_to_previous', False)
self.printer.load_object(config, 'gcode_move') self.printer.load_object(config, 'gcode_move')