diff --git a/config/example-extras.cfg b/config/example-extras.cfg index 53488f44..bf7a73f5 100644 --- a/config/example-extras.cfg +++ b/config/example-extras.cfg @@ -1086,6 +1086,10 @@ #kick_start_time: # See the "fan" section in example.cfg for a description of the # above parameters. +#fan_speed: 1.0 +# The fan speed (expressed as a value from 0.0 to 1.0) that the fan +# will be set to when a heater or stepper driver is active. +# The default is 1.0 #idle_timeout: # The ammount of time (in seconds) after a stepper driver or heater # was active and the fan should be kept running. The default @@ -1093,8 +1097,7 @@ #idle_speed: # The fan speed (expressed as a value from 0.0 to 1.0) that the fan # will be set to when a heater or stepper driver was active and before -# the idle_timeout is reached. This must be greater or equal -# max_power. The default is max_power +# the idle_timeout is reached. The default is fan_speed. #heater: # Name of the config section defining the heater that this fan is # associated with. If a comma separated list of heater names is diff --git a/klippy/extras/controller_fan.py b/klippy/extras/controller_fan.py index 89e365a9..1828a200 100644 --- a/klippy/extras/controller_fan.py +++ b/klippy/extras/controller_fan.py @@ -17,12 +17,10 @@ class ControllerFan: self.heaters = [] self.fan = fan.PrinterFan(config) self.mcu = self.fan.mcu_fan.get_mcu() - self.max_power = config.getfloat( - 'max_power', default=1., - minval=0., maxval=1.) + self.fan_speed = config.getfloat( + 'fan_speed', default=1., minval=0., maxval=1.) self.idle_speed = config.getfloat( - 'idle_speed', default=self.max_power, - minval=0., maxval=self.max_power) + 'idle_speed', default=self.fan_speed, minval=0., maxval=1.) self.idle_timeout = config.getint("idle_timeout", default=30, minval=0) self.heater_name = config.get("heater", "extruder") self.last_on = self.idle_timeout @@ -45,7 +43,7 @@ class ControllerFan: active = True if active: self.last_on = 0 - power = self.max_power + power = self.fan_speed elif self.last_on < self.idle_timeout: power = self.idle_speed self.last_on += 1