//Create a class for carbon monoxide detector package CarbonMonoxideDetector import SmartThing.SmartThing public class CarbonMonoxideDetector 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() CarbonMonoxideDetector(Closure sendEvent, String id, String label, String displayName, String currentCarbonMonoxideValue) { deviceValueSmartThing = deviceValuesMap idSmartThing = id labelSmartThing = label displayNameSmartThing = displayName sendEventSmartThings = sendEvent // Initialization this.id = id this.label = label this.displayName = displayName deviceValuesMap.put("carbonMonoxide", currentCarbonMonoxideValue) } }