Difference between revisions of "InstalledApp Object"

From Hubitat Documentation
Jump to: navigation, search
(fixed an example that was formatted incorrectly and documented most of the updateSetting overloads.)
Line 24: Line 24:
  
 
:;Example
 
:;Example
::<code> def appLabel = app.getLabel()
+
def appLabel = app.getLabel()
log.debug "app label is ${appLabel}"</code>
+
log.debug "app label is ${appLabel}"
 
 
  
 
=== <code>updateLabel</code> ===
 
=== <code>updateLabel</code> ===
Line 36: Line 35:
 
:;Parameters
 
:;Parameters
 
::label - new label for installed app
 
::label - new label for installed app
 +
 +
:;Returns
 +
::None
 +
 +
===<code>updateSetting</code>===
 +
:Updates the value of a setting (preference) to the specified value. If the setting does not exist, this method will create it.
 +
 +
:;Signature
 +
::<code>void updateSetting(String name, Long value)</code>
 +
::<code>void updateSetting(String name, Boolean value)</code>
 +
::<code>void updateSetting(String name, String value)</code>
 +
::<code>void updateSetting(String name, Double value)</code>
 +
::<code>void updateSetting(String name, Date value)</code>
 +
::<code>void updateSetting(String name, List value)</code>
 +
 +
:;Parameters
 +
::name - The name of the setting to update
 +
::value - The value to store in the setting
  
 
:;Returns
 
:;Returns
Line 42: Line 59:
 
== <code>Additional Methods to Document</code> ==
 
== <code>Additional Methods to Document</code> ==
 
  void updateSetting(String name, Map options)
 
  void updateSetting(String name, Map options)
void updateSetting(String name, Long value)
 
void updateSetting(String name, Boolean value)
 
void updateSetting(String name, String value)
 
void updateSetting(String name, Double value)
 
void updateSetting(String name, Date value)
 
void updateSetting(String name, List value)
 
 
  void removeSetting(String name)
 
  void removeSetting(String name)
 
  void clearSetting(String name)
 
  void clearSetting(String name)

Revision as of 18:22, 5 April 2020

getInstallationState

Returns a value indicating whether the app is currently installed or, if you are in the initial setup, that it is not.
Signature
String getInstallationState()
Parameters
None
Returns
COMPLETE if the app is installed, otherwise INCOMPLETE.

getLabel

Get the current label of the installed app.
Signature
String getLabel()
Parameters
None
Returns
The current label of the installed app
Example
def appLabel = app.getLabel()
log.debug "app label is ${appLabel}"

updateLabel

Update the label of the installed app
Signature
void updateLabel(String label)
Parameters
label - new label for installed app
Returns
None

updateSetting

Updates the value of a setting (preference) to the specified value. If the setting does not exist, this method will create it.
Signature
void updateSetting(String name, Long value)
void updateSetting(String name, Boolean value)
void updateSetting(String name, String value)
void updateSetting(String name, Double value)
void updateSetting(String name, Date value)
void updateSetting(String name, List value)
Parameters
name - The name of the setting to update
value - The value to store in the setting
Returns
None

Additional Methods to Document

void updateSetting(String name, Map options)
void removeSetting(String name)
void clearSetting(String name)
Long getId()
Long getName()
List<EventSubscriptionWrapper> getSubscriptions()