2cea98823ab97b67113d7103299e29069fdcd819
[smartthings-infrastructure.git] / MobilePresence / MobilePresences.groovy
1 //Create a class for mobile presence
2 package MobilePresence
3 import SmartThing.SmartThings
4
5 public class MobilePresences extends SmartThings {
6         List mobilePresences = new ArrayList()
7         
8         MobilePresences(Closure sendEvent) {
9                 // Only initialize one time since we only have one device for each capability
10                 mobilePresences = smartThings
11
12                 // Initialization
13                 StringBuilder id = new StringBuilder("mobileDeviceID0")
14                 StringBuilder label = new StringBuilder("mobileDevice")
15                 StringBuilder displayName = new StringBuilder("mobileDevice0")
16                 StringBuilder deviceNetworkId = new StringBuilder("mobile0")
17
18                 mobilePresences.add(new MobilePresence(sendEvent, id, label, displayName, deviceNetworkId))
19         }
20
21         // Methods to return values
22         def getDeviceNetworkId() {
23                 List tmpValues = new ArrayList()
24                 tmpValues.add(mobilePresences[0].getDeviceNetworkId())
25                 return tmpValues
26         }
27 }