Removing getXXX methods + properties. Adding getProperty feature to SmartThing(s)
[smartthings-infrastructure.git] / IlluminanceMeasurement / IlluminanceMeasurements.groovy
index 0944a02a7c6e4b43501f246de2e38198ca0bdbf7..5977e4682b9fd8b70968137b5dbbf84cbf4ef315 100644 (file)
@@ -2,34 +2,23 @@
 package IlluminanceMeasurement
 import SmartThing.SmartThings
 
-//Importing mutable integer class
-import MutableInteger.MutableInteger
-
 public class IlluminanceMeasurements extends SmartThings {
        List illuminanceMeasurements = new ArrayList()
                
        IlluminanceMeasurements(Closure sendEvent, boolean init) {
-               // Only initialize one time since we only have one device for each capability
                illuminanceMeasurements = smartThings
 
                // Initialization
-               StringBuilder id = new StringBuilder("illuminanceID0")
-               StringBuilder label = new StringBuilder("illuminance")
-               StringBuilder displayName = new StringBuilder("illuminance0")
-               MutableInteger illuminance = new MutableInteger()
+               String id = "illuminanceID0"
+               String label = "illuminance"
+               String displayName = "illuminanceSensor"
+               Integer illuminance
 
                if (init)
-                       illuminance.setValue(20000)
+                       illuminance = 20000
                else
-                       illuminance.setValue(5)
+                       illuminance = 5
 
                illuminanceMeasurements.add(new IlluminanceMeasurement(sendEvent, id, label, displayName, illuminance))
        }
-
-       // Methods to return values
-       def getCurrentIlluminance() {
-               List tmpValues = new ArrayList()
-               tmpValues.add(illuminanceMeasurements[0].getCurrentIlluminance())
-               return tmpValues
-       }
 }