1 //Create a class for mobile presence
3 import SmartThing.SmartThings
5 public class MobilePresences extends SmartThings {
6 List mobilePresences = new ArrayList()
8 MobilePresences(Closure sendEvent) {
9 // Only initialize one time since we only have one device for each capability
10 mobilePresences = smartThings
13 StringBuilder id = new StringBuilder("mobileDeviceID0")
14 StringBuilder label = new StringBuilder("mobileDevice")
15 StringBuilder displayName = new StringBuilder("mobileDevice0")
16 StringBuilder deviceNetworkId = new StringBuilder("mobile0")
18 mobilePresences.add(new MobilePresence(sendEvent, id, label, displayName, deviceNetworkId))
21 // Methods to return values
22 def getDeviceNetworkId() {
23 List tmpValues = new ArrayList()
24 tmpValues.add(mobilePresences[0].getDeviceNetworkId())