1 //Create a class for door control device
3 import SmartThing.SmartThings
5 public class DoorControls extends SmartThings {
6 List doorControls = new ArrayList()
8 DoorControls(Closure sendEvent, boolean init) {
9 // Only initialize one time since we only have one device for each capability
10 doorControls = smartThings
13 String id = "doorControlID0"
14 String label = "doorControl"
15 String displayName = "doorController"
23 doorControls.add(new DoorControl(sendEvent, id, label, displayName, door))
26 // Methods to set values
28 doorControls[0].open()
31 def open(LinkedHashMap metaData) {
36 doorControls[0].close()
39 def close(LinkedHashMap metaData) {