projects
/
smartthings-infrastructure.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Removing getXXX methods + properties. Adding getProperty feature to SmartThing(s)
[smartthings-infrastructure.git]
/
Battery
/
Battery.groovy
diff --git
a/Battery/Battery.groovy
b/Battery/Battery.groovy
index 3e4e5116e8047f7c911f39b929bcec9583870f79..7162d6824066efdc7fb6b2f6dcb9cbab6f508dc9 100644
(file)
--- a/
Battery/Battery.groovy
+++ b/
Battery/Battery.groovy
@@
-2,21
+2,16
@@
package Battery
import SmartThing.SmartThing
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
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
// Maps from features to values
- HashMap<String,
MutableInteger> deviceIntValuesMap = new HashMap<String, Mutable
Integer>()
+ HashMap<String,
Integer> deviceIntValuesMap = new HashMap<String,
Integer>()
- Battery(Closure sendEvent, String
Builder id, StringBuilder label, StringBuilder displayName, Mutable
Integer currentBattery) {
- deviceIntValue
sMap = deviceIntValueSmartThing
+ Battery(Closure sendEvent, String
id, String label, String displayName,
Integer currentBattery) {
+ deviceIntValue
SmartThing = deviceIntValuesMap
idSmartThing = id
labelSmartThing = label
displayNameSmartThing = displayName
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.id = id
this.label = label
this.displayName = displayName
- this.currentBattery = currentBattery
deviceIntValuesMap.put("battery", currentBattery)
}
deviceIntValuesMap.put("battery", currentBattery)
}
-
- // Methods to return values
- def getCurrentBattery() {
- return currentBattery.toString()
- }
}
}