+ class StateAuf(AbstractStateWhereOpeningIsRedundant):
+ def __init__(self,sm):
+ AbstractStateWhereOpeningIsRedundant.__init__(sm)
+ self.last_buzzed = None
+ def handle_pins_event(self):
+ pins = self.pins()
+ if pins.bell_ringing:
+ now = time.time()
+ if self.last_buzzed is None or now-self.last_buzzed < AUF_BELLBUZZ_REPEAT_TIME:
+ logger.info("buzzing because of bell ringing in state auf")
+ self.actor().act(Actor.CMD_BUZZ)
+ self.last_buzzed = now
+ if not pins.space_active:
+ logger.info("space switch off - starting leaving procedure")
+ return StateAboutToLeave(self.state_machine)
+ if pins.door_locked:
+ logger.error("door manually locked, but space switch on - going to StateZu")
+ play_sound("manual_lock")
+ return StateZu(self.state_machine)
+ # handle_wakeup_event intentionally not overwritten