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 <kevin@koconnor.net>
This commit is contained in:
parent
de57ce3a99
commit
103dcf27ff
|
@ -6,6 +6,11 @@ All dates in this document are approximate.
|
|||
|
||||
# Changes
|
||||
|
||||
20210720: A controller_fan section now monitors all stepper motors by
|
||||
default (not just the kinematic stepper motors). If the previous
|
||||
behavior is desired, see the `stepper` config option in the
|
||||
[config reference](Config_Reference.md#controller_fan).
|
||||
|
||||
20210703: A `samd_sercom` config section must now specify the sercom
|
||||
bus it is configuring via the `sercom` option.
|
||||
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -127,7 +127,7 @@ class PrinterStepperEnable:
|
|||
raise self.printer.config_error("Unknown stepper '%s'" % (name,))
|
||||
return self.enable_lines[name]
|
||||
def get_steppers(self):
|
||||
return [e.stepper for e in self.enable_lines.values()]
|
||||
return list(self.enable_lines.keys())
|
||||
|
||||
def load_config(config):
|
||||
return PrinterStepperEnable(config)
|
||||
|
|
Loading…
Reference in New Issue