Skip to content

Commit

Permalink
添加max_target参数
Browse files Browse the repository at this point in the history
  • Loading branch information
GuoGeTiertime committed Nov 6, 2024
1 parent 09a2c84 commit 3d898b7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion klippy/extras/heaters.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def __init__(self, config, sensor):
self.sensor = sensor
self.min_temp = config.getfloat('min_temp', minval=KELVIN_TO_CELSIUS)
self.max_temp = config.getfloat('max_temp', above=self.min_temp)
self.max_target = config.getfloat('max_target', default=self.max_temp)
self.sensor.setup_minmax(self.min_temp, self.max_temp)
self.sensor.setup_callback(self.temperature_callback)
self.pwm_delay = self.sensor.get_report_time_delta()
Expand Down Expand Up @@ -118,7 +119,7 @@ def set_temp(self, degrees):
"Requested temperature (%.1f) out of range (%.1f:%.1f)"
% (degrees, self.min_temp, self.max_temp))
with self.lock:
self.target_temp = degrees
self.target_temp = min(degrees, self.max_target)
def get_temp(self, eventtime):
print_time = self.mcu_pwm.get_mcu().estimated_print_time(eventtime) - 5.
with self.lock:
Expand Down

0 comments on commit 3d898b7

Please sign in to comment.