X-Git-Url: https://git.ralfj.de/saartuer.git/blobdiff_plain/bdf4adf1c9155148f713dd6e7eda955c495155b3..344d58d13b3ec1d7fb26d13de114d6e8afbe3218:/statemachine.py diff --git a/statemachine.py b/statemachine.py index 3a27ada..a3c4aff 100644 --- a/statemachine.py +++ b/statemachine.py @@ -143,13 +143,14 @@ class StateMachine(): 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() @@ -176,8 +177,7 @@ class StateMachine(): 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()