1 //Create a class for contact sensor
3 import SmartThing.SmartThings
5 public class ContactSensors extends SmartThings {
6 List contacts = new ArrayList()
8 ContactSensors(Closure sendEvent, boolean init) {
9 // Only initialize one time since we only have one device for each capability
10 contacts = smartThings
13 String id = "contactID0"
14 String label = "contact"
15 String displayName = "contactSensor"
19 currentContact = "closed"
21 currentContact = "open"
23 contacts.add(new ContactSensor(sendEvent, id, label, displayName, currentContact))