Skip to content

Latest commit

 

History

History
185 lines (142 loc) · 4.15 KB

pages.md

File metadata and controls

185 lines (142 loc) · 4.15 KB

SmartThings SDK

Configuration Pages Reference

Page

page (id, definition)

app.page.('pageOne', (page) => {
    page.nextPageId('pageTwo')
    ...
})

Creates a new configuration page. All pages must have an ID, which is used to reference the page in link and next/previous fields.

Page Properties

name (text)

Specify the name appearing at the top of this page. If omitted and i18n localization has been configured then this text is taked from the appropriate locale file.

complete ( true | false )

If true then the Done button appears on the page, allowing the app to be installed or updated.

nextPageId (id)

ID of the page to display when the Next button is pressed.

previousPageId (id)

ID of the page to display when the Back button is pressed.

Section

section([title], definition)

app.page.('pageOne', (page) => {
    page.section('Select sensors', (section) => {
        section.hideable(true)
        ...
    })
})

Add a section to the page. All inputs are contained within a section. Sections optionally can have a title

Section Properties

hideable (value)

Section contents can be displayed or hidden on the page. Hideable sections should have titles for clarity.

hidden(value)

The initial state of the section is hidden.

Settings

app.page.('pageOne', (page) => {
    page.section('Select sensors', (section) => {
        section.deviceSetting('motionSensors')
            .capability('motionSensor)
            .multiple(true)
    })
})

Common Setting Properties

The following properties can be set for any type of setting

name (text)
description (text)
disabled (true|false)
required (true|false)
defaultValue (value)

booleanSetting (id)

image (url)
submitOnChange (true|false)

decimalSetting (id)

image (url)
min (value)
max (value)
postMessage (text)

deviceSetting (id)

multiple (true|false)
closeOnSelection (true|false)
submitOnChange (true|false)
preselect (true|false)
capability (string)
apabilities (list)
excludeCapability (string)
excludeCapabilities (list)
capability (string)
permissions (string | list)

emailSetting (id)

image (url)

enumSetting (id)

multiple (true|false)
closeOnSelection (true|false)
groupedOptions (list)
options (list)
submitOnChange (true|false)
style ('COMPLETE'|'ERROR'|'DROPDOWN'|DEFAULT')

imageSetting (id)

image (url)

imagesSetting (id)

images (list)

linkSetting (id)

url (url)
image (url)
style ('COMPLETE'|'ERROR'|'BUTTON'|DEFAULT')

modeSetting (id)

multiple (true|false)
closeOnSelection (true|false)
submitOnChange (true|false)
style ('COMPLETE'|'ERROR'|DEFAULT')

numberSetting (id)

image (url)
min (value)
max (value)
postMessage (text)

oauthSetting (id)

urlTemplate (url)
style ('COMPLETE'|'ERROR'|DEFAULT')

paragraphSetting (id)

image (url)
text (text)

passwordSetting (id)

image (url)
minLength (value)
maxLength (value)

phoneSetting (id)

image (url)

sceneSetting (id)

multiple (true|false)
closeOnSelection (true|false)
submitOnChange (true|false)
style ('COMPLETE'|'ERROR'|DEFAULT')

securitySetting (id)

multiple (true|false)
closeOnSelection (true|false)
submitOnChange (true|false)
style ('COMPLETE'|'ERROR'|'DROPDOWN'|DEFAULT')

soundSetting (id)

multiple (true|false)
closeOnSelection (true|false)
groupedOptions (list)
options (list)
submitOnChange (true|false)
style ('COMPLETE'|'ERROR'|'DROPDOWN'|DEFAULT')

textSetting (id)

image (url)
minLength (value)
maxLength (value)
postMessage (text)

timeSetting (id)

image (url)

videoSetting (id)

image (url)
video (url)