diff --git a/light.sh b/light.sh index 89395a8..322c8b8 100755 --- a/light.sh +++ b/light.sh @@ -12,16 +12,16 @@ sign() { ROOM_COUNT=3 DFAULT_LIGHT_STATE=0 STATE_0="a\x00\x03\x00\x00\x00|000000000000000000;\ -a\x00\x03\x00\x00\x00|;\ +a\x00\x03\x00\x00\x00|000000;\ 000000000000000000" STATE_1="a\x00\x03\xff\xff\xff|255255255255255255;\ -a\x00\x03\xff\xff\xff|;\ +a\x00\x03\xff\xff\xff|FFFFFF;\ 000000000000000000" STATE_2="n\x00\x02\x01\x00|!;\ -n\x00\x02\x01\x00|;\ +n\x00\x02\x01\x00|FFCC11;\ 000000000000000000" STATE_3="!/usr/bin/python3 /home/automation/fensterbogenbeleuchtung_animations/animations.py|!;\ -a\x00\x03\xff\xff\xff|;\ +a\x00\x03\xff\xff\xff|FFCC11;\ 000000000000000000" get_room_color_string() { @@ -81,10 +81,14 @@ case "$ROOM_NUMBER" in fi ;; 2) - COLOR_A="$(echo "$STATE" | cut -d";" -f2 | cut -d"|" -f1)" - # COLOR_B="$(echo "$STATE" | cut -d";" -f2 | cut -d"|" -f2)" - echo -en "$COLOR_A" > /dev/udp/172.23.92.18/49152 & - # echo -en "$COLOR_B" > /dev/null + # COLOR_A="$(echo "$STATE" | cut -d";" -f2 | cut -d"|" -f1)" + COLOR_B="$(echo "$STATE" | cut -d";" -f2 | cut -d"|" -f2)" + # echo -en "$COLOR_A" > /dev/udp/172.23.92.18/49152 & + COLOR_B_TMP=$COLOR_B + for i in 5 4 3; do + wget -q -O- http://172.23.92.5/ecmd?channel%20$i%20$(printf "%d" "0x${COLOR_B_TMP:0:2}") > /dev/null 2>&1 + COLOR_B_TMP="$(echo "$COLOR_B_TMP" | cut -c3-)" + done ;; 3) # COLOR_A="$(echo "$STATE" | cut -d";" -f3 | cut -d"|" -f1)"