implemented basic support for main light in e-lab

This commit is contained in:
Florian Schlegel 2017-03-13 22:46:52 +01:00
parent 85c0c3cc0e
commit 129029cb4f
1 changed files with 12 additions and 8 deletions

View File

@ -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)"