gunsticks unsaved changes

master
Georges Herber 2016-05-07 08:38:24 +02:00
parent 950267983a
commit ecfca93d0d
4 changed files with 11 additions and 11 deletions

View File

@ -8,7 +8,6 @@ cd $(dirname "$0")
showleds() {
./redi.sh <<EOF
valid=no
neoaction=$1
neored=$2
neogreen=$3
@ -125,10 +124,10 @@ do
else
while wget -O - --timeout=1 --tries=1 $BUZZERSTATUSURL|grep '<relay1state>1</relay1state>'
do
ledcolor 0 255 0
sleep 0.9
ledcolor 0 255 255
sleep 0.1
ledcolor 0 255 0
# sleep 0.2
ledcolor 0 255 255
# sleep 0.2
done
fi
logger $0 "button push action finished"

View File

@ -13,7 +13,7 @@ do
sleep 1
while true
do
read -t 1 status <&"${COPROC[0]}"
read -t 1 status <&"${COPROC[0]}" 2>/dev/null
ret=$?
if [ $ret -eq 1 ] # no more coprocess
then
@ -56,10 +56,10 @@ do
fi
logger $0 "phone status change detected"
if [ "$new_status" -eq 0 ]; then
echo "neoaction=flash" | ./redi.sh
printf "neoaction=flash\nvalid=yes\n" | ./redi.sh
echo "flashon" >&"${COPROC[1]}"
else
echo "neoaction=pulse" | ./redi.sh
printf "neoaction=pulse\nvalid=yes\n" | ./redi.sh
echo "flashoff" >&"${COPROC[1]}"
fi
# echo $new_status > ${run_file}

View File

@ -66,10 +66,11 @@ if __name__ == '__main__':
valid="yes"
if ( valid != "yes" ):
continue
myredis.set('valid','no')
if(action == "set"):
print "Color set to: ",r,g,b
for i in range(0,LED_COUNT):
strip.setPixelColor(i, Color(r,g,b))
strip.setPixelColor(i, Color(g,r,b))
showit()
if(action == "number"):
tmp=myredis.get('neovalue')

View File

@ -10,7 +10,7 @@ import os
GPIO.setmode(GPIO.BCM)
GPIO.setup(buttonpin, GPIO.IN, pull_up_down=GPIO.PUD_UP)
exit
while True:
print "waiting..."
os.system('logger shutdownbutton waiting for press...')
@ -18,7 +18,7 @@ while True:
GPIO.wait_for_edge(buttonpin, GPIO.FALLING)
print('Button Pressed')
os.system('logger shutdownbutton pressen. bye bye')
os.system("shutdown now -h")
# os.system("shutdown now -h")
except KeyboardInterrupt:
GPIO.cleanup() # clean up GPIO on CTRL+C exit
GPIO.cleanup() #