From 5a2f406fd1e67c29744a194dedcecde20ba09107 Mon Sep 17 00:00:00 2001 From: Paul McGowan Date: Wed, 9 Sep 2020 23:10:35 -0400 Subject: [PATCH] probe: add get_status wrapper to probe for last_query from query_probe command (#3296) Add get_status wrapper with last_query status for macros It is sometimes useful to determine the state of the probe from a macro. If the probe is connected to an endstop pin, the results can be obtained via QUERY_ENDSTOPS but if a physical endstop is in use in addition to the probe the probe state cannot be obtained. This change allows one to use QUERY_PROBE and then access the printer.probe.last_query object to obtain the state. Signed-off-by: Paul McGowan --- docs/Command_Templates.md | 4 ++++ klippy/extras/probe.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/docs/Command_Templates.md b/docs/Command_Templates.md index 2be30810..13ef1b18 100644 --- a/docs/Command_Templates.md +++ b/docs/Command_Templates.md @@ -194,6 +194,10 @@ The following are common printer attributes: QUERY_ENDSTOP command. Note, due to the order of template expansion (see above), the QUERY_STATUS command must be run prior to the macro containing this reference. +- `printer.probe.last_query`: Returns True if the probe was reported + as "triggered" during the last QUERY_PROBE command. Note, due to the + order of template expansion (see above), the QUERY_STATUS command + must be run prior to the macro containing this reference. - `printer.configfile.config["
"]["