Currently the klippy:ready event handler breaks the rules by pausing the reactor. This happens when using mcu_tmc.
As a result of that, the printer will appear ready to Moonraker before it really, which then can lead to Moonraker sending commands to a not-ready Klipper. A scenario where this happens (moonraker-timelapse) and details can be found in the discussion of https://github.com/Klipper3d/klipper/pull/6631.
This fix moves the problematic code out of the event handler by registering a callback which then runs the tuning.
Currently the klippy:ready event handler breaks the rules by pausing the reactor. This happens when using mcu_tmc.
As a result of that, the printer will appear ready to Moonraker before it really, which then can lead to Moonraker sending commands to a not-ready Klipper. A scenario where this happens (moonraker-timelapse) and details can be found in the discussion of https://github.com/Klipper3d/klipper/pull/6631.
This fix moves the problematic code out of the event handler by registering a callback which then runs the tuning.