constrain duty cycle to temp a -> 100

This commit is contained in:
Lonja Selter
2019-03-28 17:53:08 +00:00
parent 567666c3c8
commit cceb90ebdc

View File

@@ -695,6 +695,7 @@ class EnclosurePlugin(octoprint.plugin.StartupPlugin, octoprint.plugin.TemplateP
try:
calculated_duty = ((current_temp - temp_a) * (duty_b - duty_a) / (temp_b - temp_a)) + duty_a
calculated_duty = self.constrain(calculated_duty, duty_a,100)
except:
calculated_duty = 0