App Object

From Hubitat Documentation
Revision as of 18:21, 10 May 2019 by Cschwer (talk | contribs)
Jump to: navigation, search

Provided Methods

unsubscribe

Unsubscribe from events sent from a device or all event subscriptions.
Signature
void unsubscribe()
void unsubscribe(DeviceWrapper device)
void unsubscribe(List<DeviceWrapper> deviceList)
void unsubscribe(DeviceWrapper device, String attributeName) (Since 2.0.7)
void unsubscribe(List<DeviceWrapper> deviceList, String attributeName) (Since 2.1.0)
void unsubscribe(DeviceWrapper device, String attributeName, String handlerMethod) (Since 2.1.0)
void unsubscribe(List<DeviceWrapper> deviceList, String attributeName, String handlerMethod) (Since 2.1.0)
Parameters
device - The device to unsubscribe from.
deviceList - A list of devices to unsubscribe from.
attributeName - which attribute you want to unsubscribe from.
handlerMethod - The name of a method which was subscribed to a device event.
Returns
None

User Defined Methods

installed

This method is called when the app is first installed.
Signature
void installed()

updated

This method is called when the preferences of an installed app are updated.
Signature
void updated()



Additional to be documented

Map getState()
String getHubUID()
String getApiServerUrl()
String getFullApiServerUrl()
String apiServerUrl(String url)
String getLocalApiServerUrl()
String getFullLocalApiServerUrl()
String localApiServerUrl(String url)
String fullLocalApiServerUrl(String url)
void setLocationMode(String mode)
String createAccessToken()
void pause(Long millisecs)
InstalledAppWrapper getParent()
InstalledAppWrapper addChildApp(String namespace, String name, String label, Map properties = null)
void deleteChildApp(Long childAppId)
ChildDeviceWrapper getChildDevice(String deviceNetworkId)
List<ChildDeviceWrapper> getChildDevices()
List<ChildDeviceWrapper> getAllChildDevices()
ChildDeviceWrapper addChildDevice(String namespace, String typeName, String deviceNetworkId, Long hubId = null, Map properties = null)
void deleteChildDevice(String deviceNetworkId)
DeviceWrapper getSubscribedDeviceById(Long deviceId)
void sendEvent(Map properties)
void sendEvent(DeviceWrapper device, Map properties)
void sendEvent(String dni, Map properties)
List<Event> getLocationEventsSince(String attributeName, Date startDate, Map options = null)
void unsubscribe()
void unsubscribe(DeviceWrapper device)
void unsubscribe(List<DeviceWrapper> devices)
void subscribe(Object thing, String attributeName, handlerMethod, Map options = null)
void subscribe(Object thing, handlerMethod)
void sendSms(String phone, String message)
void sendSmsMessage(String phone, String message)
List<InstalledApp> getAllChildApps()
List<InstalledApp> getChildApps()
InstalledAppWrapper getChildAppById(Long childAppId)
InstalledAppWrapper getChildAppByLabel(String childAppLabel)