aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras/fan.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2018-04-04 12:07:41 -0400
committerKevin O'Connor <kevin@koconnor.net>2018-04-04 12:26:39 -0400
commit4eeb43b191e3d928cf817d3be0350711dc05526d (patch)
treeff125436b053e70aac5c0f8ce3a668f90dde6fc5 /klippy/extras/fan.py
parenta4439b93b79395cbc1cf5d39f856701922dfdd84 (diff)
downloadkutter-4eeb43b191e3d928cf817d3be0350711dc05526d.tar.gz
kutter-4eeb43b191e3d928cf817d3be0350711dc05526d.tar.xz
kutter-4eeb43b191e3d928cf817d3be0350711dc05526d.zip
pins: Remove module level get_printer_pins() and setup_pin() functions
Most callers did a lookup of the pins module via printer.lookup_object("pins"). Use that as the standard method and remove these less frequently used methods. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/extras/fan.py')
-rw-r--r--klippy/extras/fan.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/klippy/extras/fan.py b/klippy/extras/fan.py
index 86572971..929ad172 100644
--- a/klippy/extras/fan.py
+++ b/klippy/extras/fan.py
@@ -3,7 +3,6 @@
# Copyright (C) 2016-2018 Kevin O'Connor <kevin@koconnor.net>
#
# This file may be distributed under the terms of the GNU GPLv3 license.
-import pins
FAN_MIN_TIME = 0.100
@@ -13,8 +12,8 @@ class PrinterFan:
self.last_fan_time = 0.
self.max_power = config.getfloat('max_power', 1., above=0., maxval=1.)
self.kick_start_time = config.getfloat('kick_start_time', 0.1, minval=0.)
- printer = config.get_printer()
- self.mcu_fan = pins.setup_pin(printer, 'pwm', config.get('pin'))
+ ppins = config.get_printer().lookup_object('pins')
+ self.mcu_fan = ppins.setup_pin('pwm', config.get('pin'))
self.mcu_fan.setup_max_duration(0.)
cycle_time = config.getfloat('cycle_time', 0.010, above=0.)
hardware_pwm = config.getboolean('hardware_pwm', False)