aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras/bed_mesh.py
diff options
context:
space:
mode:
Diffstat (limited to 'klippy/extras/bed_mesh.py')
-rw-r--r--klippy/extras/bed_mesh.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/klippy/extras/bed_mesh.py b/klippy/extras/bed_mesh.py
index 1625bbcc..dc6eba33 100644
--- a/klippy/extras/bed_mesh.py
+++ b/klippy/extras/bed_mesh.py
@@ -53,6 +53,8 @@ class BedMesh:
FADE_DISABLE = 0x7FFFFFFF
def __init__(self, config):
self.printer = config.get_printer()
+ self.printer.register_event_handler("klippy:connect",
+ self.handle_connect)
self.last_position = [0., 0., 0., 0.]
self.calibrate = BedMeshCalibrate(config, self)
self.z_mesh = None
@@ -74,10 +76,9 @@ class BedMesh:
'BED_MESH_CLEAR', self.cmd_BED_MESH_CLEAR,
desc=self.cmd_BED_MESH_CLEAR_help)
self.gcode.set_move_transform(self)
- def printer_state(self, state):
- if state == 'connect':
- self.toolhead = self.printer.lookup_object('toolhead')
- self.calibrate.load_default_profile()
+ def handle_connect(self):
+ self.toolhead = self.printer.lookup_object('toolhead')
+ self.calibrate.load_default_profile()
def set_mesh(self, mesh):
if mesh is not None:
if self.base_fade_target is None: