From 60352f4b67b5e215b7aba196295bd23e0109b163 Mon Sep 17 00:00:00 2001 From: Alex Zellner <37265689+zellneralex@users.noreply.github.com> Date: Tue, 11 May 2021 19:17:22 +0200 Subject: [PATCH] filament_motion_sensor: add get_status (#4281) Signed-off-by: Alex Zellner --- docs/Status_Reference.md | 9 +++++++++ klippy/extras/filament_motion_sensor.py | 1 + 2 files changed, 10 insertions(+) diff --git a/docs/Status_Reference.md b/docs/Status_Reference.md index dcb957f3..169394f3 100644 --- a/docs/Status_Reference.md +++ b/docs/Status_Reference.md @@ -55,6 +55,15 @@ objects: - `filament_detected`: Returns True if the sensor is in a triggered state. +# filament_motion_sensor + +The following information is available in +[filament_motion_sensor some_name](Config_Reference.md#filament_motion_sensor) +objects: +- `enabled`: Returns True if the motion sensor is currently enabled. +- `filament_detected`: Returns True if the sensor is in a triggered + state. + # firmware_retraction The following information is available in the diff --git a/klippy/extras/filament_motion_sensor.py b/klippy/extras/filament_motion_sensor.py index a3efa436..fb886aa5 100644 --- a/klippy/extras/filament_motion_sensor.py +++ b/klippy/extras/filament_motion_sensor.py @@ -22,6 +22,7 @@ class EncoderSensor: # Get printer objects self.reactor = self.printer.get_reactor() self.runout_helper = filament_switch_sensor.RunoutHelper(config) + self.get_status = self.runout_helper.get_status self.extruder = None self.estimated_print_time = None # Initialise internal state