Kodi's addon class.
More...
Kodi's addon class.
Offers classes and functions that manipulate the add-on settings, information and localization.
Class: xbmcaddon.Addon([id])
Creates a new AddOn class.
- Parameters
-
id | [opt] string - id of the addon as specified in addon.xml |
- Note
- Specifying the addon id is not needed.
Important however is that the addon folder has the same name as the AddOn id provided in addon.xml.
You can optionally specify the addon id from another installed addon to retrieve settings from it.
- v13 Python API changes:
- id is optional as it will be auto detected for this add-on instance.
Example:
..
self.Addon = xbmcaddon.Addon()
self.Addon = xbmcaddon.Addon('script.foo.bar')
..
◆ Addon()
XBMCAddon::xbmcaddon::Addon::Addon |
( |
const char * |
id = NULL | ) |
|
|
explicit |
◆ getAddonInfo()
String XBMCAddon::xbmcaddon::Addon::getAddonInfo |
( |
|
... | ) |
|
@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> xbmcaddon.Addon([id]).getAddonInfo(id) </big></font></span></code></h4> \endhtmlonly
Returns the value of an addon property as a string.
- Parameters
-
id | string - id of the property that the module needs to access. |
- Choices for the property are
| | | |
author | changelog | description | disclaimer |
fanart | icon | id | name |
path | profile | stars | summary |
type | version | | |
- Returns
- AddOn property as a string
Example:
..
version = self.Addon.getAddonInfo('version')
..
◆ getLocalizedString()
String XBMCAddon::xbmcaddon::Addon::getLocalizedString |
( |
|
... | ) |
|
@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> xbmcaddon.Addon([id]).getLocalizedString(id) </big></font></span></code></h4> \endhtmlonly
Returns an addon's localized 'unicode string'.
- Parameters
-
id | integer - id# for string you want to localize. |
- Returns
- Localized 'unicode string'
- v13 Python API changes:
- id is optional as it will be auto detected for this add-on instance.
Example:
◆ getSetting()
String XBMCAddon::xbmcaddon::Addon::getSetting |
( |
|
... | ) |
|
@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> xbmcaddon.Addon([id]).getSetting(id) </big></font></span></code></h4> \endhtmlonly
Returns the value of a setting as a unicode string.
- Parameters
-
id | string - id of the setting that the module needs to access. |
- Returns
- Setting as a unicode string
- v13 Python API changes:
- id is optional as it will be auto detected for this add-on instance.
Example:
◆ getSettingBool()
bool XBMCAddon::xbmcaddon::Addon::getSettingBool |
( |
|
... | ) |
|
@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> xbmcaddon.Addon([id]).getSettingBool(id) </big></font></span></code></h4> \endhtmlonly
Returns the value of a setting as a boolean.
- Parameters
-
id | string - id of the setting that the module needs to access. |
- Returns
- Setting as a boolean
- v18 Python API changes:
- New function added.
Example:
..
enabled = self.Addon.getSettingBool('enabled')
..
◆ getSettingInt()
int XBMCAddon::xbmcaddon::Addon::getSettingInt |
( |
|
... | ) |
|
@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> xbmcaddon.Addon([id]).getSettingInt(id) </big></font></span></code></h4> \endhtmlonly
Returns the value of a setting as an integer.
- Parameters
-
id | string - id of the setting that the module needs to access. |
- Returns
- Setting as an integer
- v18 Python API changes:
- New function added.
Example:
..
max = self.Addon.getSettingInt('max')
..
◆ getSettingNumber()
double XBMCAddon::xbmcaddon::Addon::getSettingNumber |
( |
|
... | ) |
|
@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> xbmcaddon.Addon([id]).getSettingNumber(id) </big></font></span></code></h4> \endhtmlonly
Returns the value of a setting as a floating point number.
- Parameters
-
id | string - id of the setting that the module needs to access. |
- Returns
- Setting as a floating point number
- v18 Python API changes:
- New function added.
Example:
..
max = self.Addon.getSettingNumber('max')
..
◆ getSettingString()
String XBMCAddon::xbmcaddon::Addon::getSettingString |
( |
|
... | ) |
|
@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> xbmcaddon.Addon([id]).getSettingString(id) </big></font></span></code></h4> \endhtmlonly
Returns the value of a setting as a unicode string.
- Parameters
-
id | string - id of the setting that the module needs to access. |
- Returns
- Setting as a unicode string
- v18 Python API changes:
- New function added.
Example:
..
apikey = self.Addon.getSettingString('apikey')
..
◆ openSettings()
void XBMCAddon::xbmcaddon::Addon::openSettings |
( |
| ) |
|
@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> xbmcaddon.Addon([id]).openSettings() </big></font></span></code></h4> \endhtmlonly
Opens this scripts settings dialog.
Example:
..
self.Addon.openSettings()
..
◆ setSetting()
void XBMCAddon::xbmcaddon::Addon::setSetting |
( |
|
... | ) |
|
@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> xbmcaddon.Addon([id]).setSetting(id, value) </big></font></span></code></h4> \endhtmlonly
Sets a script setting.
- Parameters
-
id | string - id of the setting that the module needs to access. |
value | string or unicode - value of the setting. |
- Note
- You can use the above as keywords for arguments.
- v13 Python API changes:
- id is optional as it will be auto detected for this add-on instance.
Example:
..
self.Addon.
setSetting(id=
'username', value=
'teamkodi')
..
◆ setSettingBool()
bool XBMCAddon::xbmcaddon::Addon::setSettingBool |
( |
|
... | ) |
|
@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> xbmcaddon.Addon([id]).setSettingBool(id, value) </big></font></span></code></h4> \endhtmlonly
Sets a script setting.
- Parameters
-
id | string - id of the setting that the module needs to access. |
value | boolean - value of the setting. |
- Returns
- True if the value of the setting was set, false otherwise
- Note
- You can use the above as keywords for arguments.
- v18 Python API changes:
- New function added.
Example:
..
self.Addon.setSettingBool(id='enabled', value=True)
..
◆ setSettingInt()
bool XBMCAddon::xbmcaddon::Addon::setSettingInt |
( |
|
... | ) |
|
@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> xbmcaddon.Addon([id]).setSettingInt(id, value) </big></font></span></code></h4> \endhtmlonly
Sets a script setting.
- Parameters
-
id | string - id of the setting that the module needs to access. |
value | integer - value of the setting. |
- Returns
- True if the value of the setting was set, false otherwise
- Note
- You can use the above as keywords for arguments.
- v18 Python API changes:
- New function added.
Example:
..
self.Addon.setSettingInt(id='max', value=5)
..
◆ setSettingNumber()
bool XBMCAddon::xbmcaddon::Addon::setSettingNumber |
( |
|
... | ) |
|
@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> xbmcaddon.Addon([id]).setSettingNumber(id, value) </big></font></span></code></h4> \endhtmlonly
Sets a script setting.
- Parameters
-
id | string - id of the setting that the module needs to access. |
value | float - value of the setting. |
- Returns
- True if the value of the setting was set, false otherwise
- Note
- You can use the above as keywords for arguments.
- v18 Python API changes:
- New function added.
Example:
..
self.Addon.setSettingNumber(id='max', value=5.5)
..
◆ setSettingString()
bool XBMCAddon::xbmcaddon::Addon::setSettingString |
( |
|
... | ) |
|
@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> xbmcaddon.Addon([id]).setSettingString(id, value) </big></font></span></code></h4> \endhtmlonly
Sets a script setting.
- Parameters
-
id | string - id of the setting that the module needs to access. |
value | string or unicode - value of the setting. |
- Returns
- True if the value of the setting was set, false otherwise
- Note
- You can use the above as keywords for arguments.
- v18 Python API changes:
- New function added.
Example:
..
self.Addon.setSettingString(id='username', value='teamkodi')
..
◆ ~Addon()
XBMCAddon::xbmcaddon::Addon::~Addon |
( |
| ) |
|
|
override |