//Create a class for location variable package Location import SmartThing.SmartThing public class LocationVar extends SmartThing { // id, label, and display name of the device String id String label String displayName // Maps from features to values HashMap deviceValuesMap = new HashMap() HashMap deviceIntValuesMap = new HashMap() // Other variables Phrase helloHome TimeZone timeZone def modes def hubs List contacts List phoneNumbers LocationVar(Closure sendEvent, boolean init) { deviceValueSmartThing = deviceValuesMap deviceIntValueSmartThing = deviceIntValuesMap idSmartThing = id labelSmartThing = label displayNameSmartThing = displayName sendEventSmartThings = sendEvent // Initialization String mode helloHome = new Phrase() contacts = ['AJ'] phoneNumbers = [9495379373] modes = [[name: "home"],[name: "away"],[name: "night"]] timeZone = TimeZone.getTimeZone("America/New_York") hubs = [[id:0, localIP:"128.195.204.105"]] if (init) mode = "away" else mode = "home" deviceValuesMap.put("mode", mode) deviceValuesMap.put("name", "hub0") deviceValuesMap.put("temperatureScale", "F") deviceValuesMap.put("sunset", "sunset") deviceValuesMap.put("sunrise", "sunrise") deviceValuesMap.put("sunsetTime", "sunsetTime") deviceValuesMap.put("sunriseTime", "sunriseTime") deviceIntValuesMap.put("contactBookEnabled", 1) } }