1 //Create a class for location variable
3 import SmartThing.SmartThing
5 public class LocationVar extends SmartThing {
6 // id, label, and display name of the device
10 // Maps from features to values
11 HashMap<String, String> deviceValuesMap = new HashMap<String, String>()
12 HashMap<String, Integer> deviceIntValuesMap = new HashMap<String, Integer>()
21 LocationVar(Closure sendEvent, boolean init) {
22 deviceValueSmartThing = deviceValuesMap
23 deviceIntValueSmartThing = deviceIntValuesMap
25 labelSmartThing = label
26 displayNameSmartThing = displayName
27 sendEventSmartThings = sendEvent
30 helloHome = new Phrase()
32 phoneNumbers = [9495379373]
33 modes = [[name: "home"],[name: "away"],[name: "night"]]
34 timeZone = TimeZone.getTimeZone("America/New_York")
35 hubs = [[id:0, localIP:"128.195.204.105"]]
42 deviceValuesMap.put("mode", mode)
43 deviceValuesMap.put("name", "hub0")
44 deviceValuesMap.put("temperatureScale", "F")
45 deviceValuesMap.put("sunset", "sunset")
46 deviceValuesMap.put("sunrise", "sunrise")
47 deviceValuesMap.put("sunsetTime", "sunsetTime")
48 deviceValuesMap.put("sunriseTime", "sunriseTime")
49 deviceIntValuesMap.put("contactBookEnabled", 1)