Commit 3cdf1e44 authored by Daniel Stan's avatar Daniel Stan

prise en compte du lotus sur la remote

parent bf1d12bb
......@@ -3,16 +3,31 @@
SEND=/home/dstan/433Utils/RPi_utils/codesend
ENCODE=/home/dstan/scripts-perso/utils/build_relay.py
LOTUS=/home/dstan/scripts-perso/bin/lotus
TMPDIR=/tmp/relaystates
mkdir -p $TMPDIR
relay=$(echo "$1" | sed "s/[^0-9]//g")
onfile=$TMPDIR/$relay-on
send() {
# $1 = numéro de relai, $2 = on or off
if [ "$1" -eq 5 ]; then
if [ "$2" = "on" ]; then
$LOTUS f
else
$LOTUS o
fi
else
$SEND $($ENCODE "$2" 4 "$1")
fi
}
if [ -f $onfile ]; then
$SEND $($ENCODE off 4 $relay)
send $relay off
rm $onfile
else
$SEND $($ENCODE on 4 $relay)
send $relay on
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