Removing getXXX methods + properties. Adding getProperty feature to SmartThing(s)
[smartthings-infrastructure.git] / MotionSensor / MotionSensors.groovy
1 //Create a class for motion sensor
2 package MotionSensor
3 import SmartThing.SmartThings
4
5 public class MotionSensors extends SmartThings {
6         List motionSensors = new ArrayList()
7                 
8         MotionSensors(Closure sendEvent, boolean init) {
9                 // Only initialize one time since we only have one device for each capability
10                 motionSensors = smartThings
11
12                 // Initialization
13                 String id = "motionSensorID0"
14                 String label = "motion"
15                 String displayName = "motionSensor"
16                 String motion
17
18                 if (init)
19                         motion = "inactive"
20                 else
21                         motion = "active"
22
23                 motionSensors.add(new MotionSensor(sendEvent, id, label, displayName, motion))
24         }
25 }