Skip to content

Commit

Permalink
Extras: don't throw errors on overriding resonance commands when reso…
Browse files Browse the repository at this point in the history
…nance_tester section isn't present
  • Loading branch information
miklschmidt committed Dec 27, 2024
1 parent a4ad02d commit e101592
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion configuration/klippy/ratos.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,12 @@ def register_override(self, command, func, desc):

prev_cmd = self.gcode.register_command(command, None)
if prev_cmd is None:
raise self.printer.config_error("Existing command '%s' not found in RatOS override" % (command,))
if command == 'TEST_RESONANCES' or command == 'SHAPER_CALIBRATE' and not self.config.has_section('resonance_tester'):
# No [resonance_tester] section found, don't throw an error, skip overriding.
logging.info("No [resonance_tester] section found, skipping override of command '%s'" % (command,))
return
else:
raise self.printer.config_error("Existing command '%s' not found in RatOS override" % (command,))
if command not in self.overridden_commands:
raise self.printer.config_error("Command '%s' not found in RatOS override list" % (command,))

Expand Down

0 comments on commit e101592

Please sign in to comment.