diff options
author | Pedro Lamas <pedrolamas@gmail.com> | 2023-02-06 17:20:41 +0000 |
---|---|---|
committer | KevinOConnor <kevin@koconnor.net> | 2023-02-13 12:16:17 -0500 |
commit | 4b5d0564217f653aae9604af4430eff3dc136a89 (patch) | |
tree | 47c9f9bb41e5e605cadbf8d5488589a48435995f | |
parent | 72b6bd7efa1ae282220b4bdcfb789075807ebfd2 (diff) | |
download | kutter-4b5d0564217f653aae9604af4430eff3dc136a89.tar.gz kutter-4b5d0564217f653aae9604af4430eff3dc136a89.tar.xz kutter-4b5d0564217f653aae9604af4430eff3dc136a89.zip |
stepper_enable: report status
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
-rw-r--r-- | docs/Status_Reference.md | 6 | ||||
-rw-r--r-- | klippy/extras/stepper_enable.py | 4 |
2 files changed, 10 insertions, 0 deletions
diff --git a/docs/Status_Reference.md b/docs/Status_Reference.md index 778802a5..5557cadf 100644 --- a/docs/Status_Reference.md +++ b/docs/Status_Reference.md @@ -398,6 +398,12 @@ The following information is available in - `printer["servo <config_name>"].value`: The last setting of the PWM pin (a value between 0.0 and 1.0) associated with the servo. +## stepper_enable + +The following information is available in the `stepper_enable` object (this +object is available if any stepper is defined): +- `steppers["<stepper>"]`: Returns True if the given stepper is enabled. + ## system_stats The following information is available in the `system_stats` object diff --git a/klippy/extras/stepper_enable.py b/klippy/extras/stepper_enable.py index e8b41c0a..621ff700 100644 --- a/klippy/extras/stepper_enable.py +++ b/klippy/extras/stepper_enable.py @@ -108,6 +108,10 @@ class PrinterStepperEnable: el.motor_disable(print_time) logging.info("%s has been manually disabled", stepper) toolhead.dwell(DISABLE_STALL_TIME) + def get_status(self, eventtime): + steppers = { name: et.is_motor_enabled() + for (name, et) in self.enable_lines.items() } + return {'steppers': steppers} def _handle_request_restart(self, print_time): self.motor_off() def cmd_M18(self, gcmd): |