aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2021-04-28 20:31:05 -0400
committerKevin O'Connor <kevin@koconnor.net>2021-04-28 20:32:14 -0400
commitf2e4653ca4b0ed9ee2c8d7b0aa12a5e3973fa285 (patch)
treea586800cc5590d099762619fc46889a8e1915577
parentaf7f27542f54582578b36fcd9bfbe17a1b46a875 (diff)
downloadkutter-f2e4653ca4b0ed9ee2c8d7b0aa12a5e3973fa285.tar.gz
kutter-f2e4653ca4b0ed9ee2c8d7b0aa12a5e3973fa285.tar.xz
kutter-f2e4653ca4b0ed9ee2c8d7b0aa12a5e3973fa285.zip
endstop_phase: wip
-rw-r--r--klippy/extras/endstop_phase.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/klippy/extras/endstop_phase.py b/klippy/extras/endstop_phase.py
index 8e70be74..eccee4f6 100644
--- a/klippy/extras/endstop_phase.py
+++ b/klippy/extras/endstop_phase.py
@@ -118,6 +118,7 @@ class EndstopPhases:
def __init__(self, config):
self.printer = config.get_printer()
self.tracking = {}
+ self.last_home_info = {}
# Register handlers
self.printer.register_event_handler("homing:home_rails_end",
self.handle_home_rails_end)
@@ -149,6 +150,10 @@ class EndstopPhases:
return
phase = convert_phase(driver_phase, driver_phases, len(phase_history))
phase_history[phase] += 1
+ self.last_home_info[stepper.get_name()] = {
+ 'phase': phase, 'phases': len(phase_history),
+ 'mcu_position': stepper.get_mcu_position()
+ }
def handle_home_rails_end(self, homing_state, rails):
for rail in rails:
stepper = rail.get_steppers()[0]
@@ -205,6 +210,8 @@ class EndstopPhases:
if info is None:
continue
self.generate_stats(stepper_name, info)
+ def get_status(self, eventtime):
+ return { 'last_home': self.last_home_info }
def load_config_prefix(config):
return EndstopPhase(config)