(26-Sep-2020, 10:44)ofrappier Wrote: Hi,
even inside javascript of webinterface of my reactor, we can see hidden opticalmode instructions, but how to ?
http://10.0.0.9/static/js/main.6f802eb1.js
Using this information I've created a Bash script to set the Devialet Premiere(not Reactor) to Optical Direct Mode, set volume to 70 and set the L/R channels. You need curl and jq installed.
Code:
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"
# print settings to confirm
curl -s http://$host/device/info | jq .
curl -s http://$host/opticaldirect/getall | jq .
done