aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras/fan.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2018-04-20 13:15:03 -0400
committerKevin O'Connor <kevin@koconnor.net>2018-04-20 13:15:03 -0400
commit85e6cd865c7e6e053971cac456155e5fbd97ccd6 (patch)
tree6f30ac3573561d58cb87a2ee0fe8847e705b149c /klippy/extras/fan.py
parent48e9fa04e78e4c57fbd558281170d16ab357377f (diff)
downloadkutter-85e6cd865c7e6e053971cac456155e5fbd97ccd6.tar.gz
kutter-85e6cd865c7e6e053971cac456155e5fbd97ccd6.tar.xz
kutter-85e6cd865c7e6e053971cac456155e5fbd97ccd6.zip
fan: Scale fan speed requests between 0 and max_power
If the fan's max power is limited by the config, then scale speed requests between 0 and max_power. This makes more sense for typical g-code fan speeds. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/extras/fan.py')
-rw-r--r--klippy/extras/fan.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/klippy/extras/fan.py b/klippy/extras/fan.py
index 929ad172..d59d777f 100644
--- a/klippy/extras/fan.py
+++ b/klippy/extras/fan.py
@@ -19,7 +19,7 @@ class PrinterFan:
hardware_pwm = config.getboolean('hardware_pwm', False)
self.mcu_fan.setup_cycle_time(cycle_time, hardware_pwm)
def set_speed(self, print_time, value):
- value = max(0., min(self.max_power, value))
+ value = max(0., min(self.max_power, value * self.max_power))
if value == self.last_fan_value:
return
print_time = max(self.last_fan_time + FAN_MIN_TIME, print_time)