def handle_pins_event(self):
pins = self.pins()
if not (pins.door_locked is None or pins.door_closed is None or pins.space_active is None or pins.bell_ringing is None):
- logger.info("All sensors got a value, switching to a proper state")
if self.fallback:
logger.info("Going to StateFallback because running in fallback mode")
return StateMachine.StateFallback(self.state_machine)
if pins.door_locked:
+ logger.info("All sensors got a value, switching to a proper state: Space is closed")
return StateMachine.StateZu(self.state_machine)
else:
+ logger.info("All sensors got a value, switching to a proper state: Space is (about to) open")
return StateMachine.StateAboutToOpen(self.state_machine)
return super().handle_pins_event()
self.actor().act(Actor.CMD_LOCK)
t = threading.Thread(target=_close_after_time)
t.start()
- # without return because we want to stay in fallback mode
- super().handle_pins_event()
+ # not calling superclass because we want to stay in fallback mode
def handle_wakeup_event(self):
# blink red LED
now = time.time()