mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-07-20 13:17:55 -06:00
klippy: Allow each module to define their config sections
Create add_printer_objects() functions in the fan, heater, extruder, and toolhead modules. Create the necessary printer component objects from this call instead of placing the code directly in klippy.py. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
d0e6a0928b
commit
136dccbcdf
5 changed files with 25 additions and 11 deletions
|
@ -30,3 +30,7 @@ class PrinterFan:
|
|||
self.mcu_fan.set_pwm(mcu_time, value)
|
||||
self.last_fan_time = mcu_time
|
||||
self.last_fan_value = value
|
||||
|
||||
def add_printer_objects(printer, config):
|
||||
if config.has_section('fan'):
|
||||
printer.add_object('fan', PrinterFan(printer, config.getsection('fan')))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue