These methods are usable in app code.
TIP: See also Common Methods, which includes methods available to both apps and drivers. For apps, see also App Object.
Returns the internal ID that represents the installed app in Hubitat.
Long getId()
None
The internal ID of the current app.
Retrieve the name of the installed app.
String getName()None
String - The name of the app
Retrieve the ID of the installed app's type.
Long getAppTypeId()None
Long - The ID of the app type
Retrieve the ID of the app's parent app.
Long getParentAppId()None
Long - The ID of the parent app, or null for a top-level app
Returns a value indicating whether the app is currently installed or, if you are in the initial setup, that it is not.
String getInstallationState()
None
COMPLETE if the app is installed, otherwise INCOMPLETE.
Get the current label of the installed app.
String getLabel()
None
The current label of the installed app
def appLabel = app.getLabel()
log.debug "app label is ${appLabel}"
Update the label of the installed app
void updateLabel(String label)
label - new label for installed app
None
Object getSetting(String name)
String name: name of settingValue of the setting with the specified name
Updates the value of a setting (preference) to the specified value. If the setting does not exist, this method will create it.
void updateSetting(String name, Map options)options - Map with keys type and value, e.g., [type: "number", value: 5]:
type - required; the setting type. Special handling applies to bool, number, decimal, time, enum, mode, capability, and capability-qualified names such as capability.switch. Other input types (e.g., password, email, phone, date, textarea) are stored as strings. Use the type declared by the app's input.value - required; the value to store. For enum and mode, this may be a String (one choice) or a collection of choices. For capability, this may be a device ID, a DeviceWrapper, or a collection of those; the devices must be permitted for this app.Nothing is updated if name, options, or options.type is null or otherwise falsey. The value is not validated against the input's configured options.
void updateSetting(String name, Long value) - stores a number settingvoid updateSetting(String name, Boolean value) - stores a bool settingvoid updateSetting(String name, String value) - stores a text settingvoid updateSetting(String name, Double value) - stores a decimal settingvoid updateSetting(String name, Date value) - stores a time settingvoid updateSetting(String name, List value) - stores an enum setting (one or more selections)name - The name of the setting to updatevalue - The value to store in the settingNone
Removes specified setting from saved settings (app preferences)
void removeSetting(String name)String name - name of setting to removeNone
Clears the saved value of a setting, if the setting exists and has a value.
void clearSetting(String name)name - Setting name whose value to clear.none
Retrieve the declared type of a setting.
String getSettingType(String name)name - Setting name to query.String - The setting type, or null if the name is null or there is no such setting
Retrieve the event subscriptions registered by this app.
List<EventSubscriptionWrapper> getSubscriptions()None
A list of EventSubscriptionWrapper objects
Type: Map
The app's persistent state map, also available as getState(). It has no fixed keys; keys and values are defined by the app. See App Overview for how state and atomicState differ.
Type: AppAtomicState
A view of the app's state that saves each change immediately. It refers to the same data as state. See App Overview.