1 //Create a class for sleep sensor
3 import SmartThing.SmartThings
5 public class SleepSensors extends SmartThings {
6 List sleepSensors = new ArrayList()
8 SleepSensors(Closure sendEvent, boolean init) {
9 // Only initialize one time since we only have one device for each capability
10 sleepSensors = smartThings
13 String id = "sleepSensorID0"
14 String label = "sleeping"
15 String displayName = "sleepSensor"
21 sleeping = "not sleeping"
23 sleepSensors.add(new SleepSensor(sendEvent, id, label, displayName, sleeping))