/drivers/<driver_id>/driver.settings.compose.json
file.type
property that determines what values it can have and how it is presented to the user. The value
property of each setting is the initial value of the setting, this property is required for all settings. The following setting types are supported:string
. You can optionally validate the value using a regex pattern by adding a pattern
property. For example adding "pattern": "[a-zA-Z]"
to the setting definition will make sure the user can only input letters.password
behave the same as text
but the input is visually hidden.textarea
type settings behave the same as text
but allow multi-line input.number
type settings can only contain numbers, this means that the value
must also be a number. Number settings also support min
max
and step
properties. You can also optionally provide the unit of the setting by setting the units
property.checkbox
settings can be true
or false
.dropdown
allow the user to pick a value from a predefined set of choices. The values of the checkbox must be strings.type
group to your settings to group multiple settings together with a label.label
. This acts as a read-only text field and can only be updated by your app.Device
class. You can retrieve the current values of all settings as follows:Device#onSettings()
will be called. You can overwrite the method in your device.js
to react to changes to the settings. It is also possible to throw an error from this method if the settings are invalid. The thrown error will be shown to the user and they be asked to change their settings in order to store them.Device#setSettings()
, the Device#onSettings()
function is not fired.