//Create a class for door control device package DoorControl import SmartThing.SmartThing public class DoorControl 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() DoorControl(Closure sendEvent, String id, String label, String displayName, String currentDoor) { deviceValueSmartThing = deviceValuesMap idSmartThing = id labelSmartThing = label displayNameSmartThing = displayName sendEventSmartThings = sendEvent // Initialization this.id = id this.label = label this.displayName = displayName deviceValuesMap.put("door", currentDoor) } // Methods to set values def open() { action("open", "door") } def open(LinkedHashMap metaData) { open() } def close() { action("closed", "door") } def close(LinkedHashMap metaData) { close() } }