Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions klippy/extras/probe.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,13 +328,21 @@ def get_list(printer: Printer) -> ProbeList:
return probes

def __init__(self, printer):
self.printer = printer
self.probes: dict[str, PrinterProbe] = {}
self.default_probe = None
printer.register_event_handler("klippy:connect", self._handle_connect)
gcode = printer.lookup_object("gcode")
gcode.register_command(
"LIST_PROBES", self.cmd_LIST_PROBES, desc=self.cmd_LIST_PROBES_help
)

def _handle_connect(self):
if self.default_probe is None:
probe = self.printer.lookup_object("probe", None)
if probe is not None:
self.default_probe = ("probe", probe)

def get_status(self, eventtime):
return {
"probes": list(self.probes.keys()),
Expand Down
3 changes: 3 additions & 0 deletions klippy/printer.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,9 @@ def _read_config(self):
# Create printer objects
for m in [pins, mcu]:
m.add_printer_objects(config)
from .extras.probe import ProbeList

ProbeList.get_list(self)
for section_config in config.get_prefix_sections(""):
self.load_object(config, section_config.get_name(), None)
# Kalico on-by-default extras
Expand Down
Loading