From 103dcf27ffd7cf1c4f70868c2ba1828ee4fbe37a Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Tue, 20 Jul 2021 10:34:14 -0400 Subject: controller_fan: Minor updates Document change in behavior of the controller_fan module. Lookup heater objects in connect() event handler. Return list of stepper names from stepper_enable.get_steppers(). Signed-off-by: Kevin O'Connor --- klippy/extras/controller_fan.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'klippy/extras/controller_fan.py') diff --git a/klippy/extras/controller_fan.py b/klippy/extras/controller_fan.py index 0c277723..0c886c31 100644 --- a/klippy/extras/controller_fan.py +++ b/klippy/extras/controller_fan.py @@ -28,9 +28,13 @@ class ControllerFan: self.last_on = self.idle_timeout self.last_speed = 0. def handle_connect(self): + # Heater lookup + pheaters = self.printer.lookup_object('heaters') + self.heaters = [pheaters.lookup_heater(n.strip()) + for n in self.heater_name.split(',')] + # Stepper lookup + all_steppers = self.stepper_enable.get_steppers() steppers = [n.strip() for n in self.steppers_to_monitor.split(',')] - all_steppers = [s.get_name() - for s in self.stepper_enable.get_steppers()] if steppers == [""]: self.stepper_names = all_steppers return @@ -41,9 +45,6 @@ class ControllerFan: % (steppers, ", ".join(all_steppers))) self.stepper_names = steppers def handle_ready(self): - pheaters = self.printer.lookup_object('heaters') - self.heaters = [pheaters.lookup_heater(n.strip()) - for n in self.heater_name.split(',')] reactor = self.printer.get_reactor() reactor.register_timer(self.callback, reactor.monotonic()+PIN_MIN_TIME) def get_status(self, eventtime): -- cgit v1.2.3-70-g09d2