stepper_enable: Raise an error on bad lookup_enable() call

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2019-11-14 18:05:32 -05:00
parent 9ff4f1bb2f
commit 8efa5e2db4
1 changed files with 2 additions and 0 deletions

View File

@ -95,6 +95,8 @@ class PrinterStepperEnable:
# Turn off motors # Turn off motors
self.motor_off() self.motor_off()
def lookup_enable(self, name): def lookup_enable(self, name):
if name not in self.enable_lines:
raise self.printer.config_error("Unknown stepper '%s'" % (name,))
return self.enable_lines[name] return self.enable_lines[name]
def load_config(config): def load_config(config):