mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-07-14 18:28:00 -06:00
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>
This commit is contained in:
parent
48e9fa04e7
commit
85e6cd865c
4 changed files with 9 additions and 8 deletions
|
@ -14,10 +14,8 @@ class PrinterHeaterFan:
|
|||
self.heater_temp = config.getfloat("heater_temp", 50.0)
|
||||
self.fan = fan.PrinterFan(config)
|
||||
self.mcu = self.fan.mcu_fan.get_mcu()
|
||||
max_power = self.fan.max_power
|
||||
self.fan_speed = config.getfloat(
|
||||
"fan_speed", max_power, minval=0., maxval=max_power)
|
||||
self.fan.mcu_fan.setup_start_value(0., max_power)
|
||||
self.fan_speed = config.getfloat("fan_speed", 1., minval=0., maxval=1.)
|
||||
self.fan.mcu_fan.setup_start_value(0., self.fan.max_power)
|
||||
def printer_state(self, state):
|
||||
if state == 'ready':
|
||||
pheater = self.printer.lookup_object('heater')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue