Removing getXXX methods + properties. Adding getProperty feature to SmartThing(s)
[smartthings-infrastructure.git] / DoorControl / DoorControls.groovy
1 //Create a class for door control device
2 package DoorControl
3 import SmartThing.SmartThings
4
5 public class DoorControls extends SmartThings {
6         List doorControls = new ArrayList()
7
8         DoorControls(Closure sendEvent, boolean init) {
9                 // Only initialize one time since we only have one device for each capability
10                 doorControls = smartThings
11
12                 // Initialization
13                 String id = "doorControlID0"
14                 String label = "doorControl"
15                 String displayName = "doorController"
16                 String door
17
18                 if (init)
19                         door = "open"
20                 else
21                         door = "closed"
22
23                 doorControls.add(new DoorControl(sendEvent, id, label, displayName, door))
24         }
25
26         // Methods to set values
27         def open() {
28                 doorControls[0].open()
29         }
30
31         def open(LinkedHashMap metaData) {
32                 open()
33         }
34
35         def close() {
36                 doorControls[0].close()
37         }
38
39         def close(LinkedHashMap metaData) {
40                 close()
41         }
42 }