summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsebastian.sjoholm <sebastian.sjoholm@gmail.com>2012-12-28 10:32:59 +0000
committersebastian.sjoholm <sebastian.sjoholm@gmail.com>2012-12-28 10:32:59 +0000
commitaa4d6a18eb2c00b3ccb28c8851abb3889235a111 (patch)
treee305f3d4688fb47ce85f30d250c8807a83b6b7ed
parent9da30b5bd92390dfe87df79f2b18a2979482d702 (diff)
downloaddrcontrol-aa4d6a18eb2c00b3ccb28c8851abb3889235a111.zip
drcontrol-aa4d6a18eb2c00b3ccb28c8851abb3889235a111.tar.gz
-rwxr-xr-xdrcontrol.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/drcontrol.py b/drcontrol.py
index 4eb6034..6dc81e7 100755
--- a/drcontrol.py
+++ b/drcontrol.py
@@ -117,18 +117,22 @@ def set_relay():
with BitBangDevice(cmdarg.device) as bb:
if cmdarg.verbose:
- print "Current state: " + str(bb.port)
+ print "Relay state: " + str(bb.port)
if cmdarg.state == "on":
+ if cmdarg.verbose:
+ print "Set relay " + str(cmdarg.relay) + " to ON"
bb.port |= int(relay.address[cmdarg.relay], 16)
elif cmdarg.state == "off":
+ if cmdarg.verbose:
+ print "Set relay " + str(cmdarg.relay) + " to OFF"
bb.port &= ~int(relay.address[cmdarg.relay], 16)
if cmdarg.verbose:
- print "Current state: " + str(bb.port)
+ print "Relay state: " + str(bb.port)
except Exception, err:
- print "Error: Problem with device, or device not exists: " + str(err)
+ print "Error: " + str(err)
sys.exit(1)
def check():
OpenPOWER on IntegriCloud