Kodi Community Forum

Full Version: Read Kodi setting before opening addon's settings
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,
is it possible to read a particular Kodi settings after the user requests access to addon's setting and then adjust some its setting based on some read system value?
I would like to make a linked addon setting that will read and adjust Kodi's system setting.
Or there is another method to embed some chosen Kodi system setting within the addon's setting dialog?
xbmcaddon.Addon.getSetting('setting_name')
https://romanvm.github.io/Kodistubs/_aut...addon.html
(2021-01-30, 20:19)M89SE Wrote: [ -> ]xbmcaddon.Addon.getSetting('setting_name')
https://romanvm.github.io/Kodistubs/_aut...addon.html

Yes, actually this is not a problem.
The problem is to fire this event before addon's settings are opened. 
The other way is to periodically check and update the copy of the system setting, but I thought that maybe it could be done in more elegant way.
What type of event are you trying to fire ?   I presume using the settings conditional logic won't do what you are looking for ?   To your point depending on what you are trying to do you could setup a service event and read the settings value you are wanting to trigger off of and then fire an event if the condition is matched. 


Jeff
(2021-02-02, 16:49)jbinkley60 Wrote: [ -> ]What type of event are you trying to fire ?   I presume using the settings conditional logic won't do what you are looking for ?   To your point depending on what you are trying to do you could setup a service event and read the settings value you are wanting to trigger off of and then fire an event if the condition is matched. 

Hi Jeff,
I'm pulling values of some system settings and present them in the addon's configuration. So I wanted to make it elegant to use some "before settings opened" event to read the values, process them and after that open addon's settings window.
I ended up with periodical pulling of system settings values. Not a clean solution but almost satisfactory Wink
Yes, since you are pulling system settings and attempting to adjust addon settings, I don't think the conditional logic in the settings file would work.  I believe the conditional logic is limited to the same settings file.  Your approach seems like a viable approach.  I've often been accused of my middle name being "brute force" for some of my coding solutions Smile


Jeff