1 //Create a class for location variable
5 private int contactBookEnabled
12 private List phoneNumbers
13 private String temperatureScale
16 private Phrase helloHome
18 LocationVar(Closure sendEvent) {
19 this.hubs = [[id:0, localIP:"128.195.204.105"]]
20 this.modes = [[name: "home"],[name: "away"],[name: "night"]]
22 this.helloHome = new Phrase()
23 this.contactBookEnabled = 1
24 this.contacts = ['AJ']
25 this.phoneNumbers = [9495379373]
26 this.sendEvent = sendEvent
27 this.timeZone = TimeZone.getTimeZone("America/New_York")
29 this.temperatureScale = "F"
33 def setValue(LinkedHashMap eventDataMap) {
34 def sentMode = eventDataMap['value']
35 println("The location is changed to $sentMode!")
37 sendEvent(eventDataMap)