From 94fbba80fe6042c6d2b260732bb3da5f3ee8327a Mon Sep 17 00:00:00 2001 From: Bernhard Tittelbach Date: Tue, 27 Jul 2010 23:02:00 +0000 Subject: [PATCH] update --- powersensordaemon/powerids.txt | 4 ++-- powersensordaemon/switch.cgi | 26 +++++++++++++++++++------- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/powersensordaemon/powerids.txt b/powersensordaemon/powerids.txt index 3376902..f6ef33c 100644 --- a/powersensordaemon/powerids.txt +++ b/powersensordaemon/powerids.txt @@ -13,6 +13,6 @@ ymhpower 1 ymhcd 2 ymhwdtv 3 ymhtuner 4 -ymhvolup 5 -ymhvoldown 6 +ymhvolup 555 +ymhvoldown 666 ymhvolmute 7 diff --git a/powersensordaemon/switch.cgi b/powersensordaemon/switch.cgi index 122e831..ce97a6c 100755 --- a/powersensordaemon/switch.cgi +++ b/powersensordaemon/switch.cgi @@ -16,12 +16,14 @@ for QUERY in `echo $QUERY_STRING | tr '&' ' '`; do done UNIXSOCK=/var/run/powersensordaemon/cmd.sock -VALIDIDS="decke lichter all werkzeug stereo labor dart logo idee deckehinten deckevorne ymhvolup ymhvoldown ymhcd ymhwdtv ymhtuner" +VALID_ONOFF_IDS="decke lichter all werkzeug labor dart logo idee deckehinten deckevorne" +VALID_SEND_IDS="stereo ymhvolup ymhvoldown ymhcd ymhwdtv ymhtuner" -if [ "$POWER" == "on" -o "$POWER" == "off" ]; then - for CHECKID in $VALIDIDS; do +if [ "$POWER" == "on" -o "$POWER" == "off" -o "$POWER" == "send"]; then + for CHECKID in $VALID_ONOFF_IDS $VALID_SEND_IDS; do if [ "$CHECKID" == "$ID" ]; then + [ "$POWER" == "send" ] && POWER=on echo "power $POWER $ID" | usocket $UNIXSOCK echo "Content-type: text/html" echo "" @@ -36,7 +38,7 @@ if [ "$POWER" == "on" -o "$POWER" == "off" ]; then fi DESC_werkzeug="Werkzeug LEDs" -DESC_stereo="Stereo Anlage" +DESC_stereo="Reciever On/Off" DESC_labor="Labor Licht" DESC_dart="Dart Scheibe" DESC_logo="Logo" @@ -46,8 +48,8 @@ DESC_deckevorne="Decke Vorne" DESC_decke="Deckenlichter" DESC_lichter="Alle Lichter" DESC_all="Alles" -DESC_yhmvolup="VolumeUp" -DESC_yhmvoldown="VolumeDown" +DESC_ymhvolup="VolumeUp" +DESC_ymhvoldown="VolumeDown" DESC_ymhcd="Input CD" DESC_ymhwdtv="Input WDlxTV" DESC_ymhtuner="Input Tuner" @@ -60,7 +62,7 @@ echo "Realraum rf433ctl" echo "" echo "" #echo "

Realraum rf433ctl

" -for DISPID in $VALIDIDS; do +for DISPID in $VALID_ONOFF_IDS; do NAME="$(eval echo \$DESC_$DISPID)" [ -z "$NAME" ] && NAME=$DISPID echo "
" @@ -71,5 +73,15 @@ for DISPID in $VALIDIDS; do echo "" echo "
" done +for DISPID in $VALID_SEND_IDS; do + NAME="$(eval echo \$DESC_$DISPID)" + [ -z "$NAME" ] && NAME=$DISPID + echo "
" + echo "" + echo "
$NAME
" + echo " " + echo "
" + echo "
" +done echo "" echo "" -- 1.7.10.4