Fixing bug in Mobile Presence 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                 String id = "momentaryID0"
14                 String label = "momentary"
15                 String displayName = "momentaryDevice"
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 }