@
Lunatixz. I have been looking for a way for me to use JSON RPC or something like that from a separate application to a Kodi plugin, is sys.argv something that I could use for that or is this strictly limited to plugin to plugin? Basically I want to wire up a function inside my modified PTVL addon that would allow another application to change to specific channels.
At first I was thinking of trying to utilize the JSON RPC call Addons.ExecuteAddon for instance to initiate a channel change to channel 13:
{"jsonrpc": "2.0","method": "Addons.ExecuteAddon","params": {"wait": false,"addonid": "script.pseudotv.live","params": ["?changeto=13"]},"id": 2}
And yes, this would I believe technically call default.py, aka attempting to start the plugin while it's already running. But I was thinking I would change that code and check to see if any parameters were sent, and if they were process them. If no parameters are received then it would just execute normally "give you the already running error" prompt as it usually does.
The only missing piece of my puzzle is how to grab these parameters in default.py so I can process the remote command. self.params perhaps?
Found this from here:
https://kodi.wiki/view/HOW-TO:Script_add...lt.py_file
def __init__(self, *args, **kwargs): # get the optional data and add it to a variable you can use elsewhere in your script
self.data = kwargs['optional1']
Or is this sys.argv the way to go?
I'm wiring up an old pushbutton cable box to a Phidgets USB control board that will allow a VB.NET app I am writing to send these channel commands directly to PTVL to use this box to change the channels.