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

prise en compte du lotus sur la remote

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