Commit eb3e2421 authored by Ralf's avatar Ralf
Browse files

Better logging

parent f1430a05
...@@ -136,10 +136,11 @@ class StateMachine(): ...@@ -136,10 +136,11 @@ class StateMachine():
def handle_pins_event(self): def handle_pins_event(self):
pins = self.pins() 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): 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) return StateMachine.StateZu(self.state_machine)
else: 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 StateMachine.StateAboutToOpen(self.state_machine)
return super().handle_pins_event() return super().handle_pins_event()
......
...@@ -14,6 +14,9 @@ if args.debug: ...@@ -14,6 +14,9 @@ if args.debug:
import libtuer import libtuer
libtuer.mailAddress = [] libtuer.mailAddress = []
# Not let's go!
logger.info("Starting up...")
# initialize GPIO stuff # initialize GPIO stuff
GPIO.setmode(GPIO.BOARD) GPIO.setmode(GPIO.BOARD)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment