Skip to content

Running a custom command before/after update #740

@robotfishe

Description

@robotfishe

Is your feature request related to a problem? Please describe

I run a multi-mcu setup and have some "timer too close" issues every now and then. One solution that seems to work is to set TRSYNC_TIMEOUT = 0.05 (instead of the default 0.025) in klipper/klippy/mcu.py. However, changing that file results in a git error when I try to update klipper through kiauh, and even if it didn't, a git pull would overwrite the file with the default value.

Describe the solution you'd like

What would be helpful is if there were a way to set commands to run before and after the update. For my use case, I would set the pre-update command
cd ~/klipper && git restore klippy/mcu.py
and then the post-update command
sed -i 's/TRSYNC_TIMEOUT = [0-9.]*$/TRSYNC_TIMEOUT = 0.05/' ~/klipper/klippy/mcu.py
but I expect there would be lots of other use cases for people who want to tweak their setup in a way that's not covered by config files.

Describe alternatives you've considered

Someone on github has kindly written a script to manage this specific variable and retain it through updates (https://github.com/IcePrints/klipper-trsync-timeout), but this isn't compatible with managing updates in kiauh.

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions