pushing latest changes before doorbuzz dies completely"

master
Level2 DoorBuzz 2016-05-06 20:23:01 +02:00
parent f78aab2f7f
commit de23e91533
4 changed files with 11 additions and 11 deletions

View File

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

View File

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

View File

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

View File

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