LUA api call return value

Moderator: Telldus

Post Reply
juhoroine
Posts: 4
Joined: Fri Mar 17, 2023 9:45 am

LUA api call return value

Post by juhoroine »

Hi,

a small feature request:
The local /api/luca/call?script=myScript&function=myCall does not have means to return data to the requesting client:

e.g. function
function myCall(args)
print("myCall() executed")
return "hello"
end

returns
{
"status": "success"
}

instead of "hello".

I think it would be logical if whatever the function returns, would be converted to json and send to the client.

EDIT: or even better, to maintain compatibility, return the return value encoded to something like this ("returnValue"):
{
"status": "success",
"returnValue": "hello"
}
Post Reply