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