verify_heater: Don't report a heater error if printer is shutdown
Don't log a heater verification error if that error is due to the printer being shutdown for some other reason. Those spurious error reports can be confusing. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
47b6144ff6
commit
864918b1f9
|
@ -26,6 +26,7 @@ class HeaterCheck:
|
|||
self.met_target = False
|
||||
self.last_target = self.goal_temp = self.error = 0.
|
||||
self.fault_systime = self.printer.get_reactor().NEVER
|
||||
self.check_timer = None
|
||||
def printer_state(self, state):
|
||||
if state == 'connect':
|
||||
if self.printer.get_start_args().get('debugoutput') is not None:
|
||||
|
@ -35,7 +36,11 @@ class HeaterCheck:
|
|||
self.heater = pheater.lookup_heater(self.heater_name)
|
||||
logging.info("Starting heater checks for %s", self.heater_name)
|
||||
reactor = self.printer.get_reactor()
|
||||
reactor.register_timer(self.check_event, reactor.NOW)
|
||||
self.check_timer = reactor.register_timer(self.check_event,
|
||||
reactor.NOW)
|
||||
elif state == 'shutdown' and self.check_timer is not None:
|
||||
reactor = self.printer.get_reactor()
|
||||
reactor.update_timer(self.check_timer, reactor.NEVER)
|
||||
def check_event(self, eventtime):
|
||||
temp, target = self.heater.get_temp(eventtime)
|
||||
if temp >= target - self.hysteresis:
|
||||
|
|
Loading…
Reference in New Issue