Removing getXXX methods + properties. Adding getProperty feature to SmartThing(s)
[smartthings-infrastructure.git] / MotionSensor / MotionSensors.groovy
index 194fc3f1e0617ba844c5b45b13467fac862cef54..163849083b747b233606ab2f733ae11317e5e05e 100644 (file)
@@ -10,23 +10,16 @@ public class MotionSensors extends SmartThings {
                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
-       }
 }