28.02.2023, 08:55
You need to modify the lg_execute_command function to return the response:
Then try this and see if you get anything logged:
Code:
function lg_execute_command(ip, key_address, prefix, msgtype, uri, payload)
local connection_sync = require('user.websocket_client_sync')
local url = 'ws://'..ip..':3000/'
local resp
local client = connection_sync.client(5)
local noerr,msg,headers = client:connect(url)
if noerr then
if initial_connect(client, key_address) then
resp = send_command_with_response(client, prefix, msgtype, uri, payload)
end
else
log('No connection with TV. Probably it is switched off', url, noerr, a, text)
end
local was_clean,code,reason = client:close()
log("Connection close result:", was_clean,code,reason)
return resp
end
Then try this and see if you get anything logged:
Code:
resp = lg_execute_command(LGTV65_IP, LGTV65_KEY, "", "request", "ssap://audio/getStatus", "")
log(resp)