mkleynhans wrote:Basically, when I call the JSON.RPC command in eventghost for say, Audio, Get Artists, it returns
a list of all the artists that I have in my XBMC collection in the eventghost log. I need to try and
get this out of eventghost somehow and send this to one of two remote control system processors.
I was hoping to send the eventghost log data returned when calling the JSON command using
either a TCP client connection to my processor or by sending it directly out of the serial port of
the pc running eventghost. Hopefully this makes a bit more sense...
The output in the log is just to show what data you got, to actually use the returned data you use a variable "
eg.result" it contains different data depending on what JSONRPC method you use. the
eg.result is the standard way you use any returned info in EventGhost and to use in other actions.
Below screenshot shows my test macro and log output:
I limited the GetArtists method to return 2 artists to keep the log short:
I use the Show OSD action to show the output. To use the eg.result variable in here I need to enclose it with "
{}" to access the data in the variable, you don't need to do that if using it directly in Python.
Code: Select all
{eg.result["artists"][0]["artist"]}
This shows the first "artist" from the result which is "2Pac" from my log. You need to know a bit about how to work with Python variable types to use the result.
Hopefully this gets you started.
jonib