From db7be1a6e5f948be8de25075f39b88853c78c7dc Mon Sep 17 00:00:00 2001 From: Rogerio Goncalves Date: Fri, 26 Jan 2024 22:19:29 +0000 Subject: [PATCH] dockable_probe: fix bug generating config (#133) --- klippy/extras/dockable_probe.py | 7 +++++-- klippy/extras/homing.py | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/klippy/extras/dockable_probe.py b/klippy/extras/dockable_probe.py index b4f09d009..42ce87022 100644 --- a/klippy/extras/dockable_probe.py +++ b/klippy/extras/dockable_probe.py @@ -203,7 +203,6 @@ def __init__(self, config): pin = config.get("pin") pin_params = ppins.lookup_pin(pin, can_invert=True, can_pullup=True) mcu = pin_params["chip"] - mcu.register_config_callback(self._build_config) self.mcu_endstop = mcu.setup_pin("endstop", pin_params) # Wrappers @@ -283,6 +282,10 @@ def __init__(self, config): "klippy:connect", self._handle_connect ) + self.printer.register_event_handler( + "klippy:mcu_identify", self._handle_config + ) + # Parse a string coordinate representation from the config # and return a list of numbers. # @@ -307,7 +310,7 @@ def _parse_coord(self, config, name, expected_dims=3): p[:supplied_dims] = vals return p - def _build_config(self): + def _handle_config(self): kin = self.printer.lookup_object("toolhead").get_kinematics() for stepper in kin.get_steppers(): if stepper.is_active_axis("z"): diff --git a/klippy/extras/homing.py b/klippy/extras/homing.py index 6dc8b6ffe..1f633c2c6 100644 --- a/klippy/extras/homing.py +++ b/klippy/extras/homing.py @@ -313,7 +313,7 @@ def home_rails(self, rails, forcepos, movepos): # Perform second home if retract_dist: - logging.info("needs rehome: %s", needs_rehome) + logging.info("homing:needs rehome: %s", needs_rehome) # Retract startpos = self._fill_coord(forcepos) homepos = self._fill_coord(movepos)