Basic Information:
Printer Model: Hypercube (custom printer from scratch)
MCU / Printerboard: (SKR1.4 Turbo / EBB42 - both over serial, not CAN)
klippy.log
not applicable here
Describe your issue: How do I override a built-in GCODE and still call the overridden method?
Okay, so I have two Meanwell PSUs on my printer - 5V/10A and 24V/25A. The 5V is always on and that feeds the raspberry pi 4 with klipper, the touchscreen, cameras, and both of my mcu boards. The 5V PSU is silent with no fan. Then, there’s the powerful 600W 24V PSU I switch on only when I want to print - so before running any heater or before doing any motor movements. I have a gcode macro and a pin defined in mainsail so I can switch the 24V PSU on or off that way. But I would like to use the SET_HEATER_TEMPERATURE gcode to turn on my PSU if it’s off, so I don’t have to remember to turn the PSU on myself first. This way I could just set the preheat temperature from klipperscreen or from mainsail and not think about the PSU. The same would go for motor movements, but that’s the exact same problem, so once I find the solution to this one I’ll be able to use it for that too.
The only thing I am after here is the way to call the overridden gcode, if it can be done at all. Anything else like the PSU sensing and other things I already have solutions for.
What I am looking for in a pseudo code would be something like this:
[gcode_macro SET_HEATER_TEMPERATURE]
gcode:
<DETERMINE_PSU_STATE>
{% if PSU_OFF %}
<TURN_PSU ON>
{% endif %}
CALL_ORIGINAL_SET_HEATER_TEMPERATURE
Is anything like this possible with current klipper firmware? Or should I more look in the feature request section?