Removing getXXX methods + properties. Adding getProperty feature to SmartThing(s)
[smartthings-infrastructure.git] / Battery / Battery.groovy
index 3e4e5116e8047f7c911f39b929bcec9583870f79..7162d6824066efdc7fb6b2f6dcb9cbab6f508dc9 100644 (file)
@@ -2,21 +2,16 @@
 package Battery
 import SmartThing.SmartThing
 
-//Importing mutable integer class
-import MutableInteger.MutableInteger
-
 public class Battery 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 currentBattery = 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>()
 
-       Battery(Closure sendEvent, StringBuilder id, StringBuilder label, StringBuilder displayName, MutableInteger currentBattery) {
-               deviceIntValuesMap = deviceIntValueSmartThing
+       Battery(Closure sendEvent, String id, String label, String displayName, Integer currentBattery) {
+               deviceIntValueSmartThing = deviceIntValuesMap 
                idSmartThing = id
                labelSmartThing = label
                displayNameSmartThing = displayName
@@ -26,13 +21,7 @@ public class Battery extends SmartThing {
                this.id = id
                this.label = label
                this.displayName = displayName
-               this.currentBattery = currentBattery
 
                deviceIntValuesMap.put("battery", currentBattery)
        }
-
-       // Methods to return values
-       def getCurrentBattery() {
-               return currentBattery.toString()
-       }
 }