Better logging
[saartuer.git] / statemachine.py
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):
-                               logger.info("All sensors got a value, switching to a proper state")
                                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()