motionSensors = smartThings
// Initialization
- StringBuilder id = new StringBuilder("motionSensorID0")
- StringBuilder label = new StringBuilder("motion")
- StringBuilder displayName = new StringBuilder("motionSensor0")
- StringBuilder motion = new StringBuilder()
+ String id = "motionSensorID0"
+ String label = "motion"
+ String displayName = "motionSensor"
+ String motion
if (init)
- motion.append("inactive")
+ motion = "inactive"
else
- motion.append("active")
+ motion = "active"
motionSensors.add(new MotionSensor(sendEvent, id, label, displayName, motion))
}
-
- // Methods to return values
- def getCurrentMotion() {
- List tmpValues = new ArrayList()
- tmpValues.add(motionSensors[0].getCurrentMotion())
- return tmpValues
- }
}