01.04.2021, 06:18
You already have a list of commands available. Here's a short example of play/stop event script attached to a 1-bit object:
Code:
value = event.getvalue()
if value then
value = 'play'
else
value = 'stop'
end
ip = '192.168.1.169'
http = require('socket.http')
res, code, hdrs = http.request({
url = 'http://' .. ip .. '/YamahaExtendedControl/v1/main/setPlayback?playback=' .. value,
headers = {
['X-AppName'] = 'MusicCast/1.0',
['X-AppPort'] = '41100',
}
})