From: Bernhard Tittelbach Date: Tue, 22 Oct 2013 22:29:18 +0000 (+0000) Subject: ../.. X-Git-Url: https://git.realraum.at/?a=commitdiff_plain;h=4974f585f3a7257357b3cd84f8ee8183a4c5c875;p=svn42.git ../.. --- diff --git a/router_gpio_relay_licht/mswitch.cgi b/router_gpio_relay_licht/mswitch.cgi index 6d0d587..94176ce 100755 --- a/router_gpio_relay_licht/mswitch.cgi +++ b/router_gpio_relay_licht/mswitch.cgi @@ -25,21 +25,21 @@ done print_gpio_state() { GPIOVALUE=$(cat "${GPIOPATH}${1}/value") if [ "$GPIOVALUE" = "1" ]; then - echo "1" + echo -n "true" else - echo "0" + echo -n "false" fi } gpio_is_on() { - GPIOVALUE=$(cat "${GPIOPATH}${1}/value") + GPIOVALUE=$(cat "${GPIOPATH}${1}/value") [ "$GPIOVALUE" = "1" ] } echo "Content-type: text/html" echo "" - +echo "{" for CHECKID in $VALID_ONOFF_IDS; do VAL="" VAL="$(eval echo \$GPIO_$CHECKID)" @@ -48,8 +48,9 @@ for CHECKID in $VALID_ONOFF_IDS; do fi echo -n "$CHECKID:" print_gpio_state $CHECKID + echo "," done - +echo "-1:false}" # echo "" # echo "" # echo "Realraum Relay Switch" diff --git a/router_gpio_relay_licht/switch.cgi b/router_gpio_relay_licht/switch.cgi index 9406356..926b941 100755 --- a/router_gpio_relay_licht/switch.cgi +++ b/router_gpio_relay_licht/switch.cgi @@ -35,7 +35,7 @@ print_gpio_state() { } gpio_is_on() { - GPIOVALUE=$(cat "${GPIOPATH}${1}/value") + GPIOVALUE=$(cat "${GPIOPATH}${1}/value") [ "$GPIOVALUE" = "1" ] } @@ -66,6 +66,10 @@ echo "" echo "" echo "Realraum Relay Power" echo '