Created
December 1, 2014 11:45
-
-
Save yumu19/803834858233b7809eff to your computer and use it in GitHub Desktop.
shell script of access hue API in radihue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IPADDR="10.1.100.101" | |
NUM=$1 | |
SAT=$2 | |
BRI=$3 | |
HUE=$4 | |
i=0 | |
QUERY="{\"on\":true, \"sat\":${SAT}, \"bri\":${BRI}, \"hue\":${HUE}}" | |
echo ${QUERY} | |
while [ $i -lt 555555 ] | |
do | |
curl -v -H "Content-type: application/json" -X PUT -d "${QUERY}" http://${IPADDR}/api/newdeveloper/lights/${NUM}/state | |
sleep 1s | |
i=`expr $i + 1` | |
done | |
QUERY="{\"on\":true, \"sat\":0, \"bri\":0, \"hue\":${HUE}}" | |
curl -v -H "Content-type: application/json" -X PUT -d "${QUERY}" http://${IPADDR}/api/newdeveloper/lights/${NUM}/state |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment