From 0671c96bf36369a1556ab7baf16e9c62ef6948c3 Mon Sep 17 00:00:00 2001 From: Daniel Uhl Date: Wed, 29 Jun 2011 23:15:31 +0000 Subject: [PATCH] Basic banshee remote --- powersensordaemon/switch.cgi | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/powersensordaemon/switch.cgi b/powersensordaemon/switch.cgi index 12ee06d..533058d 100755 --- a/powersensordaemon/switch.cgi +++ b/powersensordaemon/switch.cgi @@ -22,7 +22,7 @@ done UNIXSOCK=/var/run/powersensordaemon/cmd.sock VALID_ONOFF_IDS="decke ambientlights lichter all werkzeug labor dart logo spots1 deckehinten deckevorne boiler" VALID_SEND_IDS="ymhpoweron ymhpoweroff ymhpower ymhvolup ymhvoldown ymhcd ymhwdtv ymhtuner ymhaux ymhsattv ymhvolmute ymhmenu ymhplus ymhminus ymhtest ymhtimelevel ymheffect ymhprgup ymhprgdown ymhtunplus ymhtunminus ymhtunabcde ymhtape ymhvcr ymhextdec ymhsleep ymhp5 panicled blueled moviemode" - +VALID_BANSHEE_IDS="playPause next prev" [ "$POWER" == "send" ] && POWER=on if [ "$POWER" == "on" -o "$POWER" == "off" ]; then @@ -39,6 +39,20 @@ if [ "$POWER" == "on" -o "$POWER" == "off" ]; then exit 0 fi done + + for CHECKID in $VALID_BANSHEE_IDS; do + if [ "$CHECKID" == "$ID" ]; then + echo "$ID/" | nc wuerfel.realraum.at 8484 + echo "Content-type: text/html" + echo "" + echo "" + echo "" + echo "Realraum rf433ctl" + echo '' + echo "" + exit 0 + fi + done fi DESC_werkzeug="Werkzeug LEDs" @@ -146,5 +160,28 @@ for DISPID in $VALID_SEND_IDS; do fi done echo "" +echo "
" +for DISPID in $VALID_BANSHEE_IDS; do + NAME="$(eval echo \$DESC_$DISPID)" + [ -z "$NAME" ] && NAME=$DISPID + if [ -z "$AJAX" ]; then + + echo "
" + echo "" + echo "
$NAME
" + echo " " + echo " " + echo "
" + echo "
" + + else + + echo "
$NAME
" + echo " " + echo "
" + + fi +done +echo "
" echo "" echo "" -- 1.7.10.4