Kodi Community Forum

Full Version: Toggle Addon enabled/disabled via JSON-RPC
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Trying to figure out a way to toggle an addon, enabled or disabled.

I want to use the JSON-RPC to work it out if it is enabled to begin with and disable if enabled and vice versa.

Code:
curl -X POST -H "content-type:application/json" http://localhost:
8080/jsonrpc -d '{"jsonrpc":"2.0","method":"Addons.SetAddonEnabled","id":7,"pa
rams":{"addonid": "$id","enabled":true}}'

How can i get the status of the addon if it is enabled or not
{"jsonrpc": "2.0", "id": 1, "method": "Addons.GetAddonDetails","params":{"addonid":"script.cu.lrclyrics","properties":["enabled"]}}

Result

{"id":1,"jsonrpc":"2.0","result":{"addon":{"addonid":"script.cu.lrclyrics","enabled":false,"type":"xbmc.python.lyrics"}}}
(2019-07-28, 17:40)mfizz Wrote: [ -> ]Trying to figure out a way to toggle an addon, enabled or disabled.

I want to use the JSON-RPC to work it out if it is enabled to begin with and disable if enabled and vice versa.

Code:
curl -X POST -H "content-type:application/json" http://localhost:
8080/jsonrpc -d '{"jsonrpc":"2.0","method":"Addons.SetAddonEnabled","id":7,"pa
rams":{"addonid": "$id","enabled":true}}'

How can i get the status of the addon if it is enabled or not

For a single addon:
https://kodi.wiki/view/JSON-RPC_API/v8#A...donDetails

For all installed addons:
https://kodi.wiki/view/JSON-RPC_API/v8#Addons.GetAddons
Thanks guys that was simple enough
Hello , can someone help me create toggle addon enabled/disabled for docker ?