add a sispmctl_device
[~helmut/onoff.git] / onoff / tools.py
1 from .command import OnoffCommand
2
3 def sispmctl_device(sock):
4     """Create an OnoffCommand that controls the specified socket on a sispmctl
5     device.
6
7     @type sock: int
8     @param sock: the socket number of the sispmctl controlled device
9     """
10     return OnoffCommand(["sispmctl", "-o", "%d" % sock],
11                         ["sispmctl", "-f", "%d" % sock])