Removing getXXX methods + properties. Adding getProperty feature to SmartThing(s)
[smartthings-infrastructure.git] / SleepSensor / SleepSensors.groovy
1 //Create a class for sleep sensor
2 package SleepSensor
3 import SmartThing.SmartThings
4
5 public class SleepSensors extends SmartThings {
6         List sleepSensors = new ArrayList()
7         
8         SleepSensors(Closure sendEvent, boolean init) {
9                 // Only initialize one time since we only have one device for each capability
10                 sleepSensors = smartThings
11
12                 // Initialization
13                 String id = "sleepSensorID0"
14                 String label = "sleeping"
15                 String displayName = "sleepSensor"
16                 String sleeping
17
18                 if (init)
19                         sleeping = "sleeping"
20                 else
21                         sleeping = "not sleeping"
22
23                 sleepSensors.add(new SleepSensor(sendEvent, id, label, displayName, sleeping))
24         }
25 }