There are some strange things in your code.
First, it looks like that you use xbmc.getSetting()
- these function does not exist in the xbmc module. To get (and set) settings for your add-on you need to use the methods getSetting()
and setSetting()
to an instance of xbmcaddon.Addon()
.
So to get the (bool) value for "myidname.enabled" (Is this really the defined settings ID? Please show me your settings.xml) you need to use:
import xbmcaddon
addon = xbmcaddon.Addon()
myidnmame_enabled = addon.getSetting('myidname.enabled') == 'true'
Note that getSetting() returns always strings! To get the boolean value for an bool defined settings I suggest comparing to 'true'
.
To set a setting just use setSetting()
:
import xbmcaddon
addon = xbmcaddon.Addon()
addon.setSetting('setting_id', 'true')
For examples just have a look to other add-ons.
EDIT:
There are two settings.xml which are relevant:
The settings.xml where the settings are defined. This is the file you (as the add-on author) need to define. It should be located at
xbmc\addons\script.tvguide\resources\settings.xml
.The (autogenerated) user related settings.xml where XBMC stores the chosen values. This is located at
xbmc\userdata\addon_data\script.tvguide\resources\settings.xml
. You should NOT modify it.
It seems that you mixed these files. The first one should not have a "value" property! Modify this file to e.g.:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<settings>
<category label="30101">
<setting id="myid.enabled" value="false"/>
<setting id="myid1.enabled" type="bool" label="MY ID1" default="false"/>
<setting id="myid2.enabled" type="bool" label="MY ID2" default="false"/>
<setting id="myid3.enabled" type="bool" label="MY ID3" default="false"/>
<setting id="myid4.enabled" type="bool" label="MY ID4" default="false"/>
<setting id="myid5.enabled" type="bool" label="MY ID5" default="false"/>
<setting id="myid6.enabled" type="bool" label="MY ID6" default="false"/>
<setting id="myid7.enabled" type="bool" label="MY ID7" default="false"/>
</category>
</settings>