diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2017-04-29 13:57:02 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2017-06-09 18:54:34 -0400 |
commit | 136dccbcdfc6a20c8b6755afdfb65891cee3d1a7 (patch) | |
tree | fb195571d64d97f79c6197c9c46d02319d347356 /klippy/fan.py | |
parent | d0e6a0928b483f29a3bcfd86d16192bef5652042 (diff) | |
download | kutter-136dccbcdfc6a20c8b6755afdfb65891cee3d1a7.tar.gz kutter-136dccbcdfc6a20c8b6755afdfb65891cee3d1a7.tar.xz kutter-136dccbcdfc6a20c8b6755afdfb65891cee3d1a7.zip |
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>
Diffstat (limited to 'klippy/fan.py')
-rw-r--r-- | klippy/fan.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/klippy/fan.py b/klippy/fan.py index 9b78d6ab..bd66f7b5 100644 --- a/klippy/fan.py +++ b/klippy/fan.py @@ -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'))) |