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()
...
◆ getBool()
Function: getBool(id)
Returns the value of a setting as a boolean.
- Parameters
-
id | string - 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()
Function: getInt(id)
Returns the value of a setting as an integer.
- Parameters
-
id | string - 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()
Function: getNumber(id)
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
- float - Setting as a floating point number
- v20 Python API changes:
- New function added.
Example:
..
max = settings.getNumber('max')
..
◆ getString()
Function: getString(id)
Returns the value of a setting as a unicode string.
- Parameters
-
id | string - 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()
Function: getBoolList(id)
Returns the value of a setting as a list of booleans.
- Parameters
-
id | string - 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()
Function: getIntList(id)
Returns the value of a setting as a list of integers.
- Parameters
-
id | string - 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()
Function: getNumberList(id)
Returns the value of a setting as a list of floating point numbers.
- Parameters
-
id | string - 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()
Function: getStringList(id)
Returns the value of a setting as a list of unicode strings.
- Parameters
-
id | string - 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()
Function: setBool(id, value)
Sets the value of a setting.
- Parameters
-
id | string - id of the setting that the module needs to access. |
value | bool - 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()
Function: setInt(id, value)
Sets the value of a setting.
- Parameters
-
id | string - id of the setting that the module needs to access. |
value | integer - 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()
Function: setNumber(id, value)
Sets the value of a setting.
- Parameters
-
id | string - id of the setting that the module needs to access. |
value | float - 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()
Function: setString(id, value)
Sets the value of a setting.
- Parameters
-
id | string - id of the setting that the module needs to access. |
value | string 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()
Function: setBoolList(id, values)
Sets the boolean values of a list setting.
- Parameters
-
id | string - id of the setting that the module needs to access. |
values | list 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()
Function: setIntList(id, value)
Sets the integer values of a list setting.
- Parameters
-
id | string - id of the setting that the module needs to access. |
values | list 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()
Function: setNumberList(id, value)
Sets the floating point values of a list setting.
- Parameters
-
id | string - id of the setting that the module needs to access. |
values | list 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()
Function: setStringList(id, value)
Sets the string values of a list setting.
- Parameters
-
id | string - id of the setting that the module needs to access. |
values | list 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' ])
..