Create a gist now

Instantly share code, notes, and snippets.

shell script of access hue API in radihue
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