I’d like to run gcode when the idle_timeout state goes from Idle
to Ready
or Idle
to Printing
. I could do with this with delayed gcode, but that feels sloppy and I hate to keep polling for a status change when I could simply react to an event in Python.
I’d happily modify idle_timeout.py
to add something like on_ready_gcode:
, etc., as this extra already has all of the state information and hooking into the other events would be simple. Assuming all of contributor requirements are met, is this a PR that would likely be accepted?
Alternately, I could simply write a new onready.py
extra (for example), and essentially duplicate idle_timeout.py
, but this seems highly redundant. I could submit it for a PR if this seems like a desired function, or simply maintain it separately like a lot of the other extras, with the upside being that klippy updates wouldn’t wipe it out.
An obvious use case affecting more than 100 users would be, for example, to enable LEDs as soon as the printer leaves the idle state (“as soon as” meaning after finishing any gcode that un-idled the printer, that is).
What’s the preferred path here?