1 //Create a class for motion sensor
3 import SmartThing.SmartThings
5 public class MotionSensors extends SmartThings {
6 List motionSensors = new ArrayList()
8 MotionSensors(Closure sendEvent, boolean init) {
9 // Only initialize one time since we only have one device for each capability
10 motionSensors = smartThings
13 String id = "motionSensorID0"
14 String label = "motion"
15 String displayName = "motionSensor"
23 motionSensors.add(new MotionSensor(sendEvent, id, label, displayName, motion))