30.06.2020, 14:33
I got it to somewhat work by doing like this:
But then there is a delay in this sonos function so that it takes a lot of time to start all the players I have in the list.
I also now esperienced another challenge; I did a scan in the sonos network to verify my player ID's, and then the log from that scan is too long for the log-window, and I cannot see all players. Is there a way to list only player name and ID? There is a lot of information in the normal scan, and so it is not possible to see the complete result.
Code:
if alarm then
--alert('Brannalarm utløst i ' .. text)
for _, PlayerID in ipairs(players) do
--http://127.0.0.1/user/sonos.lp?action=say&uuid=' .. PlayerID .. '&audiofile=' .. audiofile .. '&volume=15&duration=200
reply = socket.http.request('http://127.0.0.1/user/sonos.lp?action=say&uuid=' .. PlayerID .. '&audiofile=' .. audiofile .. '&volume=80&duration=200')
log(PlayerID)
end
log(alarm, reply)
else
for _, PlayerID in ipairs(players) do
reply = socket.http.request('http://127.0.0.1/user/sonos.lp?action=stop&uuid=' .. PlayerID ..'')
end
log(alarm, reply)
end
But then there is a delay in this sonos function so that it takes a lot of time to start all the players I have in the list.
I also now esperienced another challenge; I did a scan in the sonos network to verify my player ID's, and then the log from that scan is too long for the log-window, and I cannot see all players. Is there a way to list only player name and ID? There is a lot of information in the normal scan, and so it is not possible to see the complete result.
There are 10 kinds of people in the world; those who can read binary and those who don't