20.01.2016, 15:05
Thanks Erwin!
here a short function to send commands to your squeezebox players. I have added them to a user library.
and this is an example for an object turning on or off the player
here a short function to send commands to your squeezebox players. I have added them to a user library.
Code:
--Functions for Logitech Media Server integration
squeezboxserverip = '192.168.0.XX' -- IP of the Logitech Media Server
function squeezeboxsendcommand(player,command)
socket=require('socket')
local client = socket.connect(squeezboxserverip, 9090)
client:send(player .. ' ' .. command .. '\n')
local result=client:receive()
log(result)
client:close()
end
and this is an example for an object turning on or off the player
Code:
require('user.squeezebox')
onoff = event.getvalue() and 1 or 0
squeezeboxsendcommand('b8:27:eb:ad:6b:c2', 'power ' .. onoff)