From: Helmut Grohne Date: Sun, 14 Jul 2013 18:54:38 +0000 (+0200) Subject: add a sispmctl_device X-Git-Url: https://git.linta.de/?p=~helmut%2Fonoff.git;a=commitdiff_plain;h=296ba160a075b2da20ba4ec5a1d50cdccd1bec38;hp=3e548ddf39ce2c984943eaaa04a56e1d517b3357 add a sispmctl_device --- diff --git a/onoff/tools.py b/onoff/tools.py new file mode 100644 index 0000000..fd5e5f2 --- /dev/null +++ b/onoff/tools.py @@ -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])