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]
/
PresenceSensor
/
PresenceSensor.groovy
diff --git
a/PresenceSensor/PresenceSensor.groovy
b/PresenceSensor/PresenceSensor.groovy
index 9c525293ed2551121642ae462ad21c3f03033f65..5ffc3fd9c7eebcb97dcf63588af8aa6ebcbc3bda 100644
(file)
--- a/
PresenceSensor/PresenceSensor.groovy
+++ b/
PresenceSensor/PresenceSensor.groovy
@@
-4,17
+4,15
@@
import SmartThing.SmartThing
public class PresenceSensor extends SmartThing {
// id, label, and display name of the device
public class PresenceSensor 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 currentPresence = 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
>()
// Possible values for eventsSince method
// Possible values for eventsSince method
- List<String
Builder> possibleValues = new ArrayList<StringBuilder
>();
+ List<String
> possibleValues = new ArrayList<String
>();
- PresenceSensor(Closure sendEvent, String
Builder id, StringBuilder label, StringBuilder displayName, StringBuilder
currentPresence) {
+ PresenceSensor(Closure sendEvent, String
id, String label, String displayName, String
currentPresence) {
deviceValuesMap = deviceValueSmartThing
idSmartThing = id
labelSmartThing = label
deviceValuesMap = deviceValueSmartThing
idSmartThing = id
labelSmartThing = label
@@
-26,15
+24,9
@@
public class PresenceSensor extends SmartThing {
this.id = id
this.label = label
this.displayName = displayName
this.id = id
this.label = label
this.displayName = displayName
- this.currentPresence = currentPresence
possibleValues.add("present")
possibleValues.add("not present")
deviceValuesMap.put("presence", currentPresence)
}
possibleValues.add("present")
possibleValues.add("not present")
deviceValuesMap.put("presence", currentPresence)
}
-
- // Methods to return values
- def getCurrentPresence() {
- return currentPresence.toString()
- }
}
}