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]
/
RelativeHumidityMeasurement
/
RelativeHumidityMeasurement.groovy
diff --git
a/RelativeHumidityMeasurement/RelativeHumidityMeasurement.groovy
b/RelativeHumidityMeasurement/RelativeHumidityMeasurement.groovy
index 8d7c4e06028571d75ba28150718f1c485e076595..9faad86be1cac222e099d3deff13ad7cbcb09c7a 100644
(file)
--- a/
RelativeHumidityMeasurement/RelativeHumidityMeasurement.groovy
+++ b/
RelativeHumidityMeasurement/RelativeHumidityMeasurement.groovy
@@
-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, Mutable
Integer>()
+ HashMap<String,
Integer> deviceIntValuesMap = new HashMap<String,
Integer>()
- RelativeHumidityMeasurement(Closure sendEvent, String
Builder id, StringBuilder label, StringBuilder displayName, Mutable
Integer currentHumidity) {
- deviceIntValue
sMap = deviceIntValueSmartThing
+ RelativeHumidityMeasurement(Closure sendEvent, String
id, String label, String displayName,
Integer currentHumidity) {
+ deviceIntValue
SmartThing = 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()
- }
}
}