Kodi Development  20.0
for Binary and Script based Add-Ons

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 = xbmc.Addon('id').getSettings()
...

Function Documentation

◆ getBool()

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')
..

◆ getInt()

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')
..

◆ getNumber()

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')
..

◆ getString()

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')
..

◆ getBoolList()

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')
..

◆ getIntList()

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')
..

◆ getNumberList()

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')
..

◆ getStringList()

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()

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.
Returns
bool - True if the value of the setting was set, false otherwise
Note
You can use the above as keywords for arguments.

v20 Python API changes:
New function added.

Example:

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

◆ setInt()

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.
Returns
bool - True if the value of the setting was set, false otherwise
Note
You can use the above as keywords for arguments.

v20 Python API changes:
New function added.

Example:

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

◆ setNumber()

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.
Returns
bool - True if the value of the setting was set, false otherwise
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)
..

◆ setString()

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.
Returns
bool - True if the value of the setting was set, false otherwise
Note
You can use the above as keywords for arguments.

v20 Python API changes:
New function added.

Example:

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

◆ setBoolList()

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.
Returns
bool - True if the values of the setting were set, false otherwise
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 ])
..

◆ setIntList()

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.
Returns
bool - True if the values of the setting were set, false otherwise
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 ])
..

◆ setNumberList()

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.
Returns
bool - True if the values of the setting were set, false otherwise
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 ])
..

◆ setStringList()

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.
Returns
bool - True if the values of the setting were set, false otherwise
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' ])
..