Only wait for space switches while we are in StateZu
[saartuer.git] / tuerd
diff --git a/tuerd b/tuerd
index 8c24cfd81777ae4b34f178a0b553a0514bdd5077..1bee788341c776acbb894475409707ea2e78a611 100755 (executable)
--- a/tuerd
+++ b/tuerd
@@ -2,6 +2,17 @@
 import RPi.GPIO as GPIO
 import statemachine, actor, pins, tysock, waker
 from libtuer import logger
+import argparse
+
+# Parse arguments
+parser = argparse.ArgumentParser(description='Run a door')
+parser.add_argument("-d", "--debug",
+                                       action="store_true", dest="debug",
+                                       help="Don't send emails")
+args = parser.parse_args()
+if args.debug:
+       import libtuer
+       libtuer.mailAddress = []
 
 # initialize GPIO stuff
 GPIO.setmode(GPIO.BOARD)