idle_timeout: exit the timer if the printer is shutdown

This resolves an issue where the timer can get stuck
in an attempt to transition from Ready to Idle if
the printer is shutdown.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan 2021-10-27 14:41:33 -04:00 committed by KevinOConnor
parent cf4bfb1119
commit d90c3bc57a
1 changed files with 2 additions and 0 deletions

View File

@ -71,6 +71,8 @@ class IdleTimeout:
# Idle timeout has elapsed
return self.transition_idle_state(eventtime)
def timeout_handler(self, eventtime):
if self.printer.is_shutdown():
return self.reactor.NEVER
if self.state == "Ready":
return self.check_idle_timeout(eventtime)
# Check if need to transition to "ready" state