Removing getXXX methods + properties. Adding getProperty feature to SmartThing(s)
[smartthings-infrastructure.git] / CarbonMonoxideDetector / CarbonMonoxideDetector.groovy
index 65f1ce0d99bf1209a2988e8888753d287fb1b6fc..045a415668fa4e08a2b0d13858583b3d46104813 100644 (file)
@@ -4,16 +4,14 @@ import SmartThing.SmartThing
 
 public class CarbonMonoxideDetector extends SmartThing {
        // id, label, and display name of the device
-       StringBuilder id = new StringBuilder()
-       StringBuilder label = new StringBuilder()
-       StringBuilder displayName = new StringBuilder()
-       // Features with string values
-       StringBuilder currentCarbonMonoxideValue = new StringBuilder()
+       String id
+       String label
+       String displayName
        // Maps from features to values
-       HashMap<String, StringBuilder> deviceValuesMap = new HashMap<String, StringBuilder>()
+       HashMap<String, String> deviceValuesMap = new HashMap<String, String>()
 
-       CarbonMonoxideDetector(Closure sendEvent, StringBuilder id, StringBuilder label, StringBuilder displayName, StringBuilder currentCarbonMonoxideValue) {
-               deviceValuesMap = deviceValueSmartThing
+       CarbonMonoxideDetector(Closure sendEvent, String id, String label, String displayName, String currentCarbonMonoxideValue) {
+               deviceValueSmartThing = deviceValuesMap 
                idSmartThing = id
                labelSmartThing = label
                displayNameSmartThing = displayName
@@ -23,13 +21,7 @@ public class CarbonMonoxideDetector extends SmartThing {
                this.id = id
                this.label = label
                this.displayName = displayName
-               this.currentCarbonMonoxideValue = currentCarbonMonoxideValue
 
                deviceValuesMap.put("carbonMonoxide", currentCarbonMonoxideValue)
        }
-
-       // Methods to return values
-       def getCurrentCarbonMonoxideValue() {
-               return currentCarbonMonoxideValue.toString()
-       }
 }