Removing getXXX methods + properties. Adding getProperty feature to SmartThing(s)
[smartthings-infrastructure.git] / IlluminanceMeasurement / IlluminanceMeasurement.groovy
index 85ae10a9f49897271c1556e981056a643d0abb2e..c62d9d845ec23c404aedc18c91d71bbb36ce9871 100644 (file)
@@ -2,21 +2,16 @@
 package IlluminanceMeasurement
 import SmartThing.SmartThing
 
-//Importing mutable integer class
-import MutableInteger.MutableInteger
-
 public class IlluminanceMeasurement extends SmartThing {
        // id, label, and display name of the device
-       StringBuilder id = new StringBuilder()
-       StringBuilder label = new StringBuilder()
-       StringBuilder displayName = new StringBuilder()
-       // Features with numberical values
-       MutableInteger currentIlluminance = new MutableInteger()
+       String id
+       String label
+       String displayName
        // Maps from features to values
-       HashMap<String, MutableInteger> deviceIntValuesMap = new HashMap<String, MutableInteger>()
+       HashMap<String, Integer> deviceIntValuesMap = new HashMap<String, Integer>()
 
-       IlluminanceMeasurement(Closure sendEvent, StringBuilder id, StringBuilder label, StringBuilder displayName, MutableInteger currentIlluminance) {
-               deviceIntValuesMap = deviceIntValueSmartThing
+       IlluminanceMeasurement(Closure sendEvent, String id, String label, String displayName, Integer currentIlluminance) {
+               deviceIntValueSmartThing = deviceIntValuesMap
                idSmartThing = id
                labelSmartThing = label
                displayNameSmartThing = displayName
@@ -26,13 +21,7 @@ public class IlluminanceMeasurement extends SmartThing {
                this.id = id
                this.label = label
                this.displayName = displayName
-               this.currentIlluminance = currentIlluminance
 
                deviceIntValuesMap.put("illuminance", currentIlluminance)
        }
-
-       // Methods to return values
-       def getCurrentIlluminance() {
-               return currentIlluminance.getValue()
-       }
 }