Kodi Community Forum
v18 Toggle Addon enabled/disabled via JSON-RPC - Printable Version

Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Kodi Application (https://forum.kodi.tv/forumdisplay.php?fid=93)
+---- Forum: JSON-RPC (https://forum.kodi.tv/forumdisplay.php?fid=174)
---- Thread: v18 Toggle Addon enabled/disabled via JSON-RPC (/showthread.php?tid=345751)



Toggle Addon enabled/disabled via JSON-RPC - mfizz - 2019-07-28

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


RE: Toggle Addon enabled/disabled via JSON-RPC - black_eagle - 2019-07-28

{"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"}}}



RE: Toggle Addon enabled/disabled via JSON-RPC - Lunatixz - 2019-07-28

(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#Addons.GetAddonDetails

For all installed addons:
https://kodi.wiki/view/JSON-RPC_API/v8#Addons.GetAddons


RE: Toggle Addon enabled/disabled via JSON-RPC - mfizz - 2019-07-29

Thanks guys that was simple enough


RE: Toggle Addon enabled/disabled via JSON-RPC - supperka1 - 2019-09-11

Hello , can someone help me create toggle addon enabled/disabled for docker ?