lumini_p30_control/lp3ctrl.sh
2023-04-24 20:26:49 +02:00

35 lines
610 B
Bash
Executable file

#!/bin/bash
LIGHT=$1
STATE=$2
BRI=$3
echo ---
curl http://192.168.0.26/state\?light=1
echo
curl http://192.168.0.26/state\?light=2
echo
curl http://192.168.0.26/state\?light=3
echo
curl http://192.168.0.26/state\?light=4
echo
echo ---
if [ "$1" ]; then
curl -i -X PUT -d '{ "'$LIGHT'": { "on": '$STATE', "bri": '$BRI' } }' http://192.168.0.26/state
echo
echo ---
curl http://192.168.0.26/state\?light=1
echo
curl http://192.168.0.26/state\?light=2
echo
curl http://192.168.0.26/state\?light=3
echo
curl http://192.168.0.26/state\?light=4
echo
echo ---
fi