Created
September 27, 2020 03:17
-
-
Save mingfang/689258d4499d3aeb7ed174fdfc8d9521 to your computer and use it in GitHub Desktop.
Set Devialet Speakers to Optical Direct Mode
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
volume=70 | |
speakers="192.168.2.103 192.168.2.60" | |
for host in $speakers; do | |
echo $host | |
# enable optical direct mode | |
curl -s http://$host/opticaldirect/enabled -XPOST | |
# name must be Left or Right | |
curl -s http://$host/device/name | jq . | |
role=$(curl -s http://$host/device/name | jq -r .data.name) | |
curl -s http://$host/opticaldirect/role -d "{\"role\":\"Front$role\"}" -H "Content-Type: application/json" | |
curl -s http://$host/opticaldirect/volume -d "{\"volume\":$volume}" -H "Content-Type: application/json" | |
curl -s http://$host/device/info | jq . | |
curl -s http://$host/opticaldirect/getall | jq . | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment