Removing getXXX methods + properties. Adding getProperty feature to SmartThing(s)
[smartthings-infrastructure.git] / AccelerationSensor / AccelerationSensor.groovy
index 3352e7d8b30bbab777a41e2d650460c6c744d030..66cae29667a2c4526bae52af63f3562b1166ea83 100644 (file)
@@ -4,38 +4,29 @@ import SmartThing.SmartThing
 
 public class AccelerationSensor 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 currentAcceleration = 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>()
        // Possible values for eventsSince method
-       List<StringBuilder> possibleValues = new ArrayList<StringBuilder>();
+       List<String> possibleValues = new ArrayList<String>();
 
-       AccelerationSensor(Closure sendEvent, StringBuilder id, StringBuilder label, StringBuilder displayName, StringBuilder currentAcceleration) {
-               deviceValuesMap = deviceValueSmartThing
-               deviceIntValuesMap = deviceIntValueSmartThing
+       AccelerationSensor(Closure sendEvent, String id, String label, String displayName, String currentAcceleration) {
+               deviceValueSmartThing = deviceValuesMap
                idSmartThing = id
                labelSmartThing = label
                displayNameSmartThing = displayName
-               sendEventSmartThings = sendEvent
                possibleValuesSmartThings = possibleValues
+               sendEventSmartThings = sendEvent
 
                // Initialization
                this.id = id
                this.label = label
                this.displayName = displayName
-               this.currentAcceleration = currentAcceleration
                possibleValues.add("active")
                possibleValues.add("inactive")
 
                deviceValuesMap.put("acceleration", currentAcceleration)
        }
-
-       // Methods to return values
-       def getCurrentAcceleration() {
-               return currentAcceleration.toString()
-       }
 }