A small change in SwitchLevel class
[smartthings-infrastructure.git] / Momentary / Momentaries.groovy
1 //Create a class for momentory switch device
2 package Momentary
3 import SmartThing.SmartThings
4
5 public class Momentaries extends SmartThings {
6         List momentaries = new ArrayList()
7
8         Momentaries(Closure sendEvent) {
9                 // Only initialize one time since we only have one device for each capability
10                 momentaries = smartThings
11
12                 // Initialization
13                 StringBuilder id = new StringBuilder("momentaryID0")
14                 StringBuilder label = new StringBuilder("momentary")
15                 StringBuilder displayName = new StringBuilder("momentary0")
16
17                 momentaries.add(new Momentary(sendEvent, id, label, displayName))
18         }
19
20         // Methods to set values
21         def push() {
22                 momentaries[0].push()
23         }
24 }