Removing getXXX methods + properties. Adding getProperty feature to SmartThing(s)
[smartthings-infrastructure.git] / RelativeHumidityMeasurement / RelativeHumidityMeasurement.groovy
index 8d7c4e06028571d75ba28150718f1c485e076595..9faad86be1cac222e099d3deff13ad7cbcb09c7a 100644 (file)
@@ -2,21 +2,16 @@
 package RelativeHumidityMeasurement
 import SmartThing.SmartThing
 
 package RelativeHumidityMeasurement
 import SmartThing.SmartThing
 
-//Importing mutable integer class
-import MutableInteger.MutableInteger
-
 public class RelativeHumidityMeasurement extends SmartThing {
        // id, label, and display name of the device
 public class RelativeHumidityMeasurement 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 currentHumidity = new MutableInteger()
+       String id
+       String label
+       String displayName
        // Maps from features to values
        // Maps from features to values
-       HashMap<String, MutableInteger> deviceIntValuesMap = new HashMap<String, MutableInteger>()
+       HashMap<String, Integer> deviceIntValuesMap = new HashMap<String, Integer>()
 
 
-       RelativeHumidityMeasurement(Closure sendEvent, StringBuilder id, StringBuilder label, StringBuilder displayName, MutableInteger currentHumidity) {
-               deviceIntValuesMap = deviceIntValueSmartThing
+       RelativeHumidityMeasurement(Closure sendEvent, String id, String label, String displayName, Integer currentHumidity) {
+               deviceIntValueSmartThing = deviceIntValuesMap
                idSmartThing = id
                labelSmartThing = label
                displayNameSmartThing = displayName
                idSmartThing = id
                labelSmartThing = label
                displayNameSmartThing = displayName
@@ -26,13 +21,7 @@ public class RelativeHumidityMeasurement extends SmartThing {
                this.id = id
                this.label = label
                this.displayName = displayName
                this.id = id
                this.label = label
                this.displayName = displayName
-               this.currentHumidity = currentHumidity
 
                deviceIntValuesMap.put("humidity", currentHumidity)
        }
 
                deviceIntValuesMap.put("humidity", currentHumidity)
        }
-
-       // Methods to return values
-       def getCurrentHumidity() {
-               return currentHumidity.getValue()
-       }
 }
 }