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]
/
CarbonMonoxideDetector
/
CarbonMonoxideDetector.groovy
diff --git
a/CarbonMonoxideDetector/CarbonMonoxideDetector.groovy
b/CarbonMonoxideDetector/CarbonMonoxideDetector.groovy
index 65f1ce0d99bf1209a2988e8888753d287fb1b6fc..045a415668fa4e08a2b0d13858583b3d46104813 100644
(file)
--- a/
CarbonMonoxideDetector/CarbonMonoxideDetector.groovy
+++ b/
CarbonMonoxideDetector/CarbonMonoxideDetector.groovy
@@
-4,16
+4,14
@@
import SmartThing.SmartThing
public class CarbonMonoxideDetector extends SmartThing {
// id, label, and display name of the device
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
// Maps from features to values
- HashMap<String, String
Builder> deviceValuesMap = new HashMap<String, StringBuilder
>()
+ HashMap<String, String
> deviceValuesMap = new HashMap<String, String
>()
- CarbonMonoxideDetector(Closure sendEvent, String
Builder id, StringBuilder label, StringBuilder displayName, StringBuilder
currentCarbonMonoxideValue) {
- deviceValue
sMap = deviceValueSmartThing
+ CarbonMonoxideDetector(Closure sendEvent, String
id, String label, String displayName, String
currentCarbonMonoxideValue) {
+ deviceValue
SmartThing = deviceValuesMap
idSmartThing = id
labelSmartThing = label
displayNameSmartThing = displayName
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.id = id
this.label = label
this.displayName = displayName
- this.currentCarbonMonoxideValue = currentCarbonMonoxideValue
deviceValuesMap.put("carbonMonoxide", currentCarbonMonoxideValue)
}
deviceValuesMap.put("carbonMonoxide", currentCarbonMonoxideValue)
}
-
- // Methods to return values
- def getCurrentCarbonMonoxideValue() {
- return currentCarbonMonoxideValue.toString()
- }
}
}