reduce cpu load while fading
This commit is contained in:
parent
7397c8f43e
commit
1246652dec
17
light.sh
17
light.sh
|
@ -137,13 +137,14 @@ case "$ROOM_NUMBER" in
|
|||
while [ $R -ne $R_ -o $G -ne $G_ -o $B -ne $B_ ]; do
|
||||
DR=$(sign $(($R_-$R))); DG=$(sign $(($G_-$G))); DB=$(sign $(($B_-$B)))
|
||||
R=$(($R+$DR)); G=$((G+$DG)); B=$(($B+$DB))
|
||||
PIDS=""
|
||||
for i in 5:${GAMMA_LUT[$R]} 4:${GAMMA_LUT[$G]} 3:${GAMMA_LUT[$B]}; do
|
||||
wget -q --timeout 3 -O- http://172.23.92.5/ecmd?channel%20$(echo $i | cut -d: -f1)%20$(echo $i | cut -d: -f2) > /dev/null 2>&1 &
|
||||
PIDS="$PIDS $!"
|
||||
COLOR_B_TMP="$(echo "$COLOR_B_TMP" | cut -c3-)"
|
||||
done
|
||||
sleep .1
|
||||
wget -q --timeout 3 -O- --input-file <(
|
||||
for i in 5:${GAMMA_LUT[$R]} 4:${GAMMA_LUT[$G]} 3:${GAMMA_LUT[$B]}; do
|
||||
echo "http://172.23.92.5/ecmd?channel%20$(echo $i | cut -d: -f1)%20$(echo $i | cut -d: -f2)"
|
||||
COLOR_B_TMP="$(echo "$COLOR_B_TMP" | cut -c3-)"
|
||||
done
|
||||
) > /dev/null 2>&1 &
|
||||
PID=$!
|
||||
sleep .2
|
||||
kill -9 $PIDS >/dev/null 2>&1
|
||||
done
|
||||
done
|
||||
|
@ -158,7 +159,7 @@ case "$ROOM_NUMBER" in
|
|||
PIDS="$PIDS $!"
|
||||
COLOR_B_TMP="$(echo "$COLOR_B_TMP" | cut -c3-)"
|
||||
done
|
||||
sleep .1
|
||||
sleep .5
|
||||
kill -9 $PIDS >/dev/null 2>&1
|
||||
fi
|
||||
;;
|
||||
|
|
Loading…
Reference in New Issue