klipper_utils.klipper_module
Klipper module with some helper functions.
- class klipper_utils.klipper_module.KlipperModule(config, cmd_prefix)
Bases:
objectGeneric base Klipper module with some helper methods.
Initialize the module.
- Parameters:
config (ConfigWrapper) – Klipper config object.
cmd_prefix (str) – Common prefix used in all registered commands.
- check_homed_xyz(gcmd)
Check the required axes are homed. Raise error if not.
- Parameters:
gcmd (Gcmd) – G-code object.
- Raises:
gcmd.error – Klipper exception when some axis are not homed.
- Return type:
None
- get_temperatures()
Read current and target bed and extruder temperatures.
- get_time()
Readable helper to get Klipper time.
- Returns:
Klipper time in seconds.
- Return type:
- move_absolute(move_to, speed)
Move to given absolute XYZ-position.
- move_inside(move_inside, speed)
Move inside the given coordinated. Do not move if already inside.
- move_relative(move_by, speed)
Move to given relative XYZ-position.
- set_temperatures(gcmd, temps)
Set bed and extruder temperatures. Does not wait for those to reach the target.
- Parameters:
gcmd (Gcmd) – G-code object.
temps (Temps) – Set temperatures.
- Return type:
None
- set_wait_temperatures(gcmd, temps, tolerance_min, tolerance_max)
Set and wait for temperatures to reach given level.
- wait(gcmd, duration)
Wait for given time.
- Parameters:
gcmd (Gcmd) – G-code object.
duration (float) – Duration to wait [s].
- Return type:
None
- wait_temperatures(gcmd, temps, tolerance_min, tolerance_max)
Wait temperatures to reach given level. Does not set them.
- property toolhead: Any
Get the toolhead.
- Returns:
Toolhead object.
- Raises:
KlipperUtilsError – If the printer is not ready.