Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches

Add-on settings More...

Classes

class  XBMCAddon::xbmcaddon::Settings
 

Functions

 XBMCAddon::xbmcaddon::Settings::getBool (...)
 

Function: getBool(id)


Returns the value of a setting as a boolean.
 
 XBMCAddon::xbmcaddon::Settings::getInt (...)
 

Function: getInt(id)


Returns the value of a setting as an integer.
 
 XBMCAddon::xbmcaddon::Settings::getNumber (...)
 

Function: getNumber(id)


Returns the value of a setting as a floating point number.
 
 XBMCAddon::xbmcaddon::Settings::getString (...)
 

Function: getString(id)


Returns the value of a setting as a unicode string.
 
 XBMCAddon::xbmcaddon::Settings::getBoolList (...)
 

Function: getBoolList(id)


Returns the value of a setting as a list of booleans.
 
 XBMCAddon::xbmcaddon::Settings::getIntList (...)
 

Function: getIntList(id)


Returns the value of a setting as a list of integers.
 
 XBMCAddon::xbmcaddon::Settings::getNumberList (...)
 

Function: getNumberList(id)


Returns the value of a setting as a list of floating point numbers.
 
 XBMCAddon::xbmcaddon::Settings::getStringList (...)
 

Function: getStringList(id)


Returns the value of a setting as a list of unicode strings.
 
 XBMCAddon::xbmcaddon::Settings::setBool (...)
 

Function: setBool(id, value)


Sets the value of a setting.
 
 XBMCAddon::xbmcaddon::Settings::setInt (...)
 

Function: setInt(id, value)


Sets the value of a setting.
 
 XBMCAddon::xbmcaddon::Settings::setNumber (...)
 

Function: setNumber(id, value)


Sets the value of a setting.
 
 XBMCAddon::xbmcaddon::Settings::setString (...)
 

Function: setString(id, value)


Sets the value of a setting.
 
 XBMCAddon::xbmcaddon::Settings::setBoolList (...)
 

Function: setBoolList(id, values)


Sets the boolean values of a list setting.
 
 XBMCAddon::xbmcaddon::Settings::setIntList (...)
 

Function: setIntList(id, value)


Sets the integer values of a list setting.
 
 XBMCAddon::xbmcaddon::Settings::setNumberList (...)
 

Function: setNumberList(id, value)


Sets the floating point values of a list setting.
 
 XBMCAddon::xbmcaddon::Settings::setStringList (...)
 

Function: setStringList(id, value)


Sets the string values of a list setting.
 

Detailed Description

Add-on settings

Class: Settings()

This wrapper provides access to the settings specific to an add-on. It supports reading and writing specific setting values.


v20 Python API changes
New class added.

Example:

...
settings = xbmcaddon.Addon('id').getSettings()
...

Function Documentation

◆ getBool()

bool XBMCAddon::xbmcaddon::Settings::getBool ( ...)

Function: getBool(id)


Returns the value of a setting as a boolean.

Parameters
idstring - id of the setting that the module needs to access.
Returns
bool - Setting as a boolean

v20 Python API changes
New function added.

Example:

..
enabled = settings.getBool('enabled')
..

◆ getBoolList()

std::vector< bool > XBMCAddon::xbmcaddon::Settings::getBoolList ( ...)

Function: getBoolList(id)


Returns the value of a setting as a list of booleans.

Parameters
idstring - id of the setting that the module needs to access.
Returns
list - Setting as a list of booleans

v20 Python API changes
New function added.

Example:

..
enabled = settings.getBoolList('enabled')
..

◆ getInt()

int XBMCAddon::xbmcaddon::Settings::getInt ( ...)

Function: getInt(id)


Returns the value of a setting as an integer.

Parameters
idstring - id of the setting that the module needs to access.
Returns
integer - Setting as an integer

v20 Python API changes
New function added.

Example:

..
max = settings.getInt('max')
..

◆ getIntList()

std::vector< int > XBMCAddon::xbmcaddon::Settings::getIntList ( ...)

Function: getIntList(id)


Returns the value of a setting as a list of integers.

Parameters
idstring - id of the setting that the module needs to access.
Returns
list - Setting as a list of integers

v20 Python API changes
New function added.

Example:

..
ids = settings.getIntList('ids')
..

◆ getNumber()

double XBMCAddon::xbmcaddon::Settings::getNumber ( ...)

Function: getNumber(id)


Returns the value of a setting as a floating point number.

Parameters
idstring - id of the setting that the module needs to access.
Returns
float - Setting as a floating point number

v20 Python API changes
New function added.

Example:

..
max = settings.getNumber('max')
..

◆ getNumberList()

std::vector< double > XBMCAddon::xbmcaddon::Settings::getNumberList ( ...)

Function: getNumberList(id)


Returns the value of a setting as a list of floating point numbers.

Parameters
idstring - id of the setting that the module needs to access.
Returns
list - Setting as a list of floating point numbers

v20 Python API changes
New function added.

Example:

..
max = settings.getNumberList('max')
..

◆ getString()

String XBMCAddon::xbmcaddon::Settings::getString ( ...)

Function: getString(id)


Returns the value of a setting as a unicode string.

Parameters
idstring - id of the setting that the module needs to access.
Returns
string - Setting as a unicode string

v20 Python API changes
New function added.

Example:

..
apikey = settings.getString('apikey')
..

◆ getStringList()

std::vector< String > XBMCAddon::xbmcaddon::Settings::getStringList ( ...)

Function: getStringList(id)


Returns the value of a setting as a list of unicode strings.

Parameters
idstring - id of the setting that the module needs to access.
Returns
list - Setting as a list of unicode strings

v20 Python API changes
New function added.

Example:

..
views = settings.getStringList('views')
..

◆ setBool()

void XBMCAddon::xbmcaddon::Settings::setBool ( ...)

Function: setBool(id, value)


Sets the value of a setting.

Parameters
idstring - id of the setting that the module needs to access.
valuebool - value of the setting.
Note
You can use the above as keywords for arguments.

v20 Python API changes
New function added.

Example:

..
settings.setBool(id='enabled', value=True)
..

◆ setBoolList()

void XBMCAddon::xbmcaddon::Settings::setBoolList ( ...)

Function: setBoolList(id, values)


Sets the boolean values of a list setting.

Parameters
idstring - id of the setting that the module needs to access.
valueslist of boolean - values of the setting.
Note
You can use the above as keywords for arguments.

v20 Python API changes
New function added.

Example:

..
settings.setBoolList(id='enabled', values=[ True, False ])
..

◆ setInt()

void XBMCAddon::xbmcaddon::Settings::setInt ( ...)

Function: setInt(id, value)


Sets the value of a setting.

Parameters
idstring - id of the setting that the module needs to access.
valueinteger - value of the setting.
Note
You can use the above as keywords for arguments.

v20 Python API changes
New function added.

Example:

..
settings.setInt(id='max', value=5)
..

◆ setIntList()

void XBMCAddon::xbmcaddon::Settings::setIntList ( ...)

Function: setIntList(id, value)


Sets the integer values of a list setting.

Parameters
idstring - id of the setting that the module needs to access.
valueslist of int - values of the setting.
Note
You can use the above as keywords for arguments.

v20 Python API changes
New function added.

Example:

..
settings.setIntList(id='max', values=[ 5, 23 ])
..

◆ setNumber()

void XBMCAddon::xbmcaddon::Settings::setNumber ( ...)

Function: setNumber(id, value)


Sets the value of a setting.

Parameters
idstring - id of the setting that the module needs to access.
valuefloat - value of the setting.
Note
You can use the above as keywords for arguments.

v20 Python API changes
New function added.

Example:

..
settings.setNumber(id='max', value=5.5)
..

◆ setNumberList()

void XBMCAddon::xbmcaddon::Settings::setNumberList ( ...)

Function: setNumberList(id, value)


Sets the floating point values of a list setting.

Parameters
idstring - id of the setting that the module needs to access.
valueslist of float - values of the setting.
Note
You can use the above as keywords for arguments.

v20 Python API changes
New function added.

Example:

..
settings.setNumberList(id='max', values=[ 5.5, 5.8 ])
..

◆ setString()

void XBMCAddon::xbmcaddon::Settings::setString ( ...)

Function: setString(id, value)


Sets the value of a setting.

Parameters
idstring - id of the setting that the module needs to access.
valuestring or unicode - value of the setting.
Note
You can use the above as keywords for arguments.

v20 Python API changes
New function added.

Example:

..
settings.setString(id='username', value='teamkodi')
..

◆ setStringList()

void XBMCAddon::xbmcaddon::Settings::setStringList ( ...)

Function: setStringList(id, value)


Sets the string values of a list setting.

Parameters
idstring - id of the setting that the module needs to access.
valueslist of string or unicode - values of the setting.
Note
You can use the above as keywords for arguments.

v20 Python API changes
New function added.

Example:

..
settings.setStringList(id='username', values=[ 'team', 'kodi' ])
..