Commit a6f7bf37 authored by Daniel Stan's avatar Daniel Stan

toggle pour irexec

parent bfd10c8e
......@@ -8,7 +8,7 @@ channel = int(sys.argv[2])
port = int(sys.argv[3])
print("Sending %s to port %d of channel %d" % (('on' if on else 'false'), port, channel), file=sys.stderr)
print("Sending %s to port %d of channel %d" % (('on' if on else 'off'), port, channel), file=sys.stderr)
code = 0b010101010101010101010101
code ^= 1<<(2*(4-channel)+16)
......
#!/bin/sh
SEND=/home/dstan/433Utils/RPi_utils/codesend
ENCODE=/home/dstan/scripts-perso/utils/build_relay.py
TMPDIR=/tmp/relaystates
mkdir -p $TMPDIR
relay=$(echo "$1" | sed "s/[^0-9]//g")
onfile=$TMPDIR/$relay-on
if [ -f $onfile ]; then
$SEND $($ENCODE off 4 $relay)
rm $onfile
else
$SEND $($ENCODE on 4 $relay)
touch $onfile
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment