"First commit!"
[smartthings-infrastructure.git] / ContactSensor / contacts.groovy
1 //Create a class for contact sensor
2 package ContactSensor
3
4 public class contacts {
5         private int id = 0
6         private String displayName
7         private String currentContact
8         private String contactLatestValue
9
10         contacts(int id, String displayName, String currentContact, String contactLatestValue) {
11                 this.id = id
12                 this.displayName = displayName
13                 this.currentContact = currentContact
14                 this.contactLatestValue = contactLatestValue
15         }
16         
17         def currentValue(String S) {
18                 if (S == "contact") {
19                         return currentContact
20                 }
21         }
22
23         def latestValue(String S) {
24                 if (S == "contact") {
25                         return contactLatestValue
26                 }
27         }
28 }
29