Skip to content

Instantly share code, notes, and snippets.

@mingfang
Created September 27, 2020 03:17
Show Gist options
  • Save mingfang/689258d4499d3aeb7ed174fdfc8d9521 to your computer and use it in GitHub Desktop.
Save mingfang/689258d4499d3aeb7ed174fdfc8d9521 to your computer and use it in GitHub Desktop.
Set Devialet Speakers to Optical Direct Mode
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