Better logging
authorRalf Jung <post@ralfj.de>
Thu, 24 Oct 2013 17:41:16 +0000 (19:41 +0200)
committerRalf Jung <post@ralfj.de>
Thu, 24 Oct 2013 17:41:16 +0000 (19:41 +0200)
statemachine.py
tuerd

index d8b7c537ff6cdf88362646f39c2ea35d5cc410c3..c73bea0321c0f42dd99350fc09f10e45e2c4e057 100644 (file)
@@ -136,10 +136,11 @@ 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):
                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 pins.door_locked:
                                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:
                                        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()
        
                                        return StateMachine.StateAboutToOpen(self.state_machine)
                        return super().handle_pins_event()
        
diff --git a/tuerd b/tuerd
index 1bee788341c776acbb894475409707ea2e78a611..ec51c94ee15fb65645a4190820e584ed40e2051d 100755 (executable)
--- a/tuerd
+++ b/tuerd
@@ -14,6 +14,9 @@ if args.debug:
        import libtuer
        libtuer.mailAddress = []
 
        import libtuer
        libtuer.mailAddress = []
 
+# Not let's go!
+logger.info("Starting up...")
+
 # initialize GPIO stuff
 GPIO.setmode(GPIO.BOARD)
 
 # initialize GPIO stuff
 GPIO.setmode(GPIO.BOARD)