add a sispmctl_device
authorHelmut Grohne <helmut@subdivi.de>
Sun, 14 Jul 2013 18:54:38 +0000 (20:54 +0200)
committerHelmut Grohne <helmut@subdivi.de>
Sun, 14 Jul 2013 18:54:38 +0000 (20:54 +0200)
onoff/tools.py [new file with mode: 0644]

diff --git a/onoff/tools.py b/onoff/tools.py
new file mode 100644 (file)
index 0000000..fd5e5f2
--- /dev/null
@@ -0,0 +1,11 @@
+from .command import OnoffCommand
+
+def sispmctl_device(sock):
+    """Create an OnoffCommand that controls the specified socket on a sispmctl
+    device.
+
+    @type sock: int
+    @param sock: the socket number of the sispmctl controlled device
+    """
+    return OnoffCommand(["sispmctl", "-o", "%d" % sock],
+                        ["sispmctl", "-f", "%d" % sock])