script to change addon settings
#1
I'm trying to change addon settings with a script that will be called when button is pressed. Unfortunately its not working. Can someone give a hand
Code:
import xbmc
import xbmcaddon
import xbmcgui
import xbmcplugin
ADDON_ID = 'script.extended.interface'
ADDON = xbmcaddon.Addon()


xbmc.executeJSONRPC('{"jsonrpc":"2.0", "method":"Settings.SetSettingValue", "params":{"script.extendedinfo":"infodialog_onclick", "value":false}, "id":1}')


I want to change the infodialog_onclick from extended.info settings

Code:
        <setting label="32163" type="bool" id="infodialog_onclick" default="true"/>
Reply
#2
the json-rpc interface can only access Kodi settings.

you need to use this python function for addon settings:
https://codedocs.xyz/xbmc/xbmc/group__py...65de44dac1
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#3
(2020-09-08, 02:13)ronie Wrote: the json-rpc interface can only access Kodi settings.

you need to use this python function for addon settings:
https://codedocs.xyz/xbmc/xbmc/group__py...65de44dac1

Hello,
I tried
Code:
xbmc.executebuiltin('xbmcaddon.Addon([script.extendedinfo]).setSettingBool(infodialog_onclick, false)')

Doesn't work. What's wrong?
Reply
#4
it's a python function, not a kodi builtin. you do not need to wrap it in a executebuiltin() call.

regarding our python docs, a param in brackets [] indicates it's optional, the brackets itself are not part of the actual function.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#5
(2020-09-08, 18:21)ronie Wrote:
Code:
it's a python function, not a kodi builtin. you do not need to wrap it in a executebuiltin() call.

regarding our python docs, a param in brackets [] indicates it's optional, the brackets itself are not part of the actual function.
This worked thank you! I'm learning Smile
Code:
xbmcaddon.Addon('script.extendedinfo').setSettingBool('infodialog_onclick', 'false')
Reply

Logout Mark Read Team Forum Stats Members Help
script to change addon settings0