From d2c2aaf55df955e1e0f727d22362d57b41e614f5 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Tue, 8 Jun 2021 10:39:55 +0000 Subject: [PATCH] extruder: expose `can_extrude` flag based on temperature Sometimes an automated filament load is implemented, but extruder might not always extrude filament. This adds a flag to check if this operation is possible. Signed-off-by: Kamil Trzcinski --- docs/Status_Reference.md | 2 ++ klippy/kinematics/extruder.py | 1 + 2 files changed, 3 insertions(+) diff --git a/docs/Status_Reference.md b/docs/Status_Reference.md index 17a759f5..81449a6a 100644 --- a/docs/Status_Reference.md +++ b/docs/Status_Reference.md @@ -144,6 +144,8 @@ The following information is available for heater objects such as the given heater. - `power`: The last setting of the PWM pin (a value between 0.0 and 1.0) associated with the heater. +- `can_extrude`: If extruder can extrude (defined by `min_extrude_temp`), + available only for [extruder](Config_Reference.md#extruder) # heaters diff --git a/klippy/kinematics/extruder.py b/klippy/kinematics/extruder.py index 6f2138ae..a232d0b7 100644 --- a/klippy/kinematics/extruder.py +++ b/klippy/kinematics/extruder.py @@ -91,6 +91,7 @@ class PrinterExtruder: self.pressure_advance_smooth_time = smooth_time def get_status(self, eventtime): return dict(self.heater.get_status(eventtime), + can_extrude=self.heater.can_extrude, pressure_advance=self.pressure_advance, smooth_time=self.pressure_advance_smooth_time) def get_name(self):