we MOVED
[saartuer.git] / actor.py
diff --git a/actor.py b/actor.py
deleted file mode 100644 (file)
index 8f57d9f..0000000
--- a/actor.py
+++ /dev/null
@@ -1,34 +0,0 @@
-from libtuer import ThreadFunction, logger
-import RPi.GPIO as GPIO
-import time
-       
-class Actor:
-       CMD_BUZZ = 0
-       CMD_UNLOCK = 1
-       CMD_LOCK = 2
-       
-       CMDs = {
-               CMD_UNLOCK:  ("unlock", 12, [(None, 0.2), (True, 0.3), (False, 0.5)]),
-               CMD_LOCK:  ("lock", 16, [(None, 0.2), (True, 0.3), (False, 0.5)]),
-               CMD_BUZZ: ("buzz", 22, [(None, 0.2), (True, 2.0), (False, 0.5)]),
-       }
-       
-       def __init__(self):
-               self.act = ThreadFunction(self._act, name="Actor")
-               for (name, pin, todo) in self.CMDs.values():
-                       GPIO.setup(pin, GPIO.OUT)
-       
-       def _act(self, cmd):
-               if cmd in self.CMDs:
-                       (name, pin, todo) = self.CMDs[cmd]
-                       logger.info("Actor: Running command %s" % name)
-                       for (value, delay) in todo:
-                               if value is not None:
-                                       logger.debug("Setting pin %d to %d" % (pin, value))
-                                       GPIO.output(pin, value)
-                               time.sleep(delay)
-               else:
-                       logger.error("Actor: Gut unknown command %d" % cmd)
-       
-       def stop(self):
-               self.act.stop()