Commit e95422a3 authored by Ralf's avatar Ralf
Browse files

Some more logging

parent ea58fbe8
......@@ -205,6 +205,7 @@ class StateMachine():
self.actor().act(Actor.CMD_GREEN_OFF)
# primitive leaving procedure if space switch turned off
if not pins.space_active and self.old_pins().space_active:
logger.info("Space was disabled, locking the door in {0} seconds".format(FALLBACK_LEAVE_DELAY_LOCK))
self._nerver = Nerver([(FALLBACK_LEAVE_DELAY_LOCK, lambda:self.actor().act(Actor.CMD_LOCK))])
if pins.space_active and pins.bell_ringing and not self.old_pins().bell_ringing:
# someone just pressed the bell
......@@ -345,8 +346,7 @@ class StateMachine():
def handle_cmd_unlock_event(self,callback):
callback("409 conflict: The sphinx is currently trying to lock the door. Try again later.")
def could_not_close(self):
if self.close_attempts == 0:
logger.critical("StateMachine: Couldn't close door after %d tries. Going back to StateAboutToOpen." % CLOSE_REPEAT_NUMBER)
(logger.critical if self.close_attempts == 0 else logger.error)("StateMachine: Couldn't close door after %d tries. Going back to StateAboutToOpen." % CLOSE_REPEAT_NUMBER)
return StateMachine.StateAboutToOpen(self.state_machine, self.close_attempts)
class StateAboutToLeave(AbstractUnlockedState):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment