From: Ralf Jung Date: Thu, 24 Oct 2013 17:45:26 +0000 (+0200) Subject: Merge branch 'master' of ralfj.de:saartuer X-Git-Url: https://git.ralfj.de/saartuer.git/commitdiff_plain/344d58d13b3ec1d7fb26d13de114d6e8afbe3218?hp=bdf4adf1c9155148f713dd6e7eda955c495155b3 Merge branch 'master' of ralfj.de:saartuer Conflicts: 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() diff --git a/tuerd b/tuerd index 50fe03f..92c4122 100755 --- a/tuerd +++ b/tuerd @@ -22,6 +22,9 @@ else: # to avoid exceptions or getting None args.fallback = False +# Not let's go! +logger.info("Starting up...") + # initialize GPIO stuff GPIO.setmode(GPIO.BOARD)