//Create a class for image capture sensor package ImageCapture import SmartThing.SmartThing public class ImageCapture extends SmartThing { // id, label, and display name of the device StringBuilder id = new StringBuilder() StringBuilder label = new StringBuilder() StringBuilder displayName = new StringBuilder() // Features with string values StringBuilder currentImage = new StringBuilder() // Maps from features to values HashMap deviceValuesMap = new HashMap() ImageCapture(Closure sendEvent, StringBuilder id, StringBuilder label, StringBuilder displayName, StringBuilder currentImage) { deviceValuesMap = deviceValueSmartThing idSmartThing = id labelSmartThing = label displayNameSmartThing = displayName sendEventSmartThings = sendEvent // Initialization this.id = id this.label = label this.displayName = displayName this.currentImage = currentImage deviceValuesMap.put("image", currentImage) } def take() { String tmpID = id.toString() println("The camera with id:$tmpID is taken a picture!") } def take(LinkedHashMap metaData) { take() } // Methods to return values def getCurrentImage() { return currentImage.toString() } }