diff --git a/docs/stereotech/guide_config/wizards.md b/docs/stereotech/guide_config/wizards.md index 335b6871aee2..6271e0524ba6 100644 --- a/docs/stereotech/guide_config/wizards.md +++ b/docs/stereotech/guide_config/wizards.md @@ -313,7 +313,9 @@ A step to port the button component, with which you can respond to button clicks button__gcode: write gcode which will be running if send the cmd [WIZARD_STEP_BUTTON] -... +button__loadingtime: + the delay about press button, default 0.0 + ``` ## status diff --git a/klippy/extras/wizard/wizard_step_button.py b/klippy/extras/wizard/wizard_step_button.py index d6b938c2a0c7..495f66d42ce1 100644 --- a/klippy/extras/wizard/wizard_step_button.py +++ b/klippy/extras/wizard/wizard_step_button.py @@ -8,10 +8,13 @@ def __init__(self, config): self.templates = {} options_name = config.get_prefix_options('button_') for option in options_name: - template_button = self.gcode_macro.load_template( - config, option) - button_name = '_'.join(option.split('_')[1:-1]) - self.templates.update({button_name: template_button}) + if option.endswith('gcode'): + template_button = self.gcode_macro.load_template( + config, option) + button_name = '_'.join(option.split('_')[1:-1]) + self.templates.update({button_name: template_button}) + # get the time delay about press button needed for rendering on the client + _ = config.getfloat('button_' + button_name + '_loadingtime', 0) # register commands self.gcode.register_mux_command("WIZARD_STEP_BUTTON", 'STEP', self.name, self.cmd_WIZARD_STEP_BUTTON, diff --git a/stereotech_config/wizards/change_material_fiber.cfg b/stereotech_config/wizards/change_material_fiber.cfg index f5e0affad975..b78debe86c15 100644 --- a/stereotech_config/wizards/change_material_fiber.cfg +++ b/stereotech_config/wizards/change_material_fiber.cfg @@ -92,6 +92,7 @@ cancel_gcode: image: wizards/change_material/change_material04.jpg description: Wizards.ChangeMaterialFiber.LoadPushPull placeholder: wizard-step-preheat +button_insert_loadingtime: 2000 action_gcode: SET_WIZARD_STEP WIZARD={wizard.name} STEP={wizard.next_step} cancel_gcode: diff --git a/stereotech_config/wizards/change_material_filament.cfg b/stereotech_config/wizards/change_material_filament.cfg index 9603b6d46aba..4f8d454879ab 100644 --- a/stereotech_config/wizards/change_material_filament.cfg +++ b/stereotech_config/wizards/change_material_filament.cfg @@ -145,6 +145,7 @@ cancel_gcode: image: wizards/change_material/change_material04.jpg description: Wizards.ChangeMaterialFilament.PressLoad placeholder: wizard-step-preheat +button_insert_loadingtime: 2000 action_gcode: SET_WIZARD_STEP WIZARD={wizard.name} STEP=CHANGE_MATERIAL_FILAMENT11 cancel_gcode: