//Create a class for motion sensor package MotionSensor import SmartThing.SmartThing public class MotionSensor 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() // Possible values for eventsSince method List possibleValues = new ArrayList(); MotionSensor(Closure sendEvent, String id, String label, String displayName, String currentMotion) { deviceValueSmartThing = deviceValuesMap idSmartThing = id labelSmartThing = label displayNameSmartThing = displayName sendEventSmartThings = sendEvent possibleValuesSmartThings = possibleValues // Initialization this.id = id this.label = label this.displayName = displayName possibleValues.add("active") possibleValues.add("inactive") deviceValuesMap.put("motion", currentMotion) } }