fan: Allow the fan shutdown_speed to be configured

Add a shutdown_speed config option to fans so that users can specify
the speed on a shutdown event.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2018-05-18 19:12:03 -04:00
parent 5712283e91
commit 2740838b2e
5 changed files with 41 additions and 25 deletions

View file

@ -12,10 +12,9 @@ class PrinterHeaterFan:
self.printer = config.get_printer()
self.heater_name = config.get("heater", "extruder0")
self.heater_temp = config.getfloat("heater_temp", 50.0)
self.fan = fan.PrinterFan(config)
self.fan = fan.PrinterFan(config, default_shutdown_speed=1.)
self.mcu = self.fan.mcu_fan.get_mcu()
self.fan_speed = config.getfloat("fan_speed", 1., minval=0., maxval=1.)
self.fan.set_shutdown_speed(1.)
def printer_state(self, state):
if state == 'ready':
pheater = self.printer.lookup_object('heater')