Adding missing methods etc.
[smartthings-infrastructure.git] / SleepSensor / SleepSensors.groovy
index 884053cc6dad2ba80430d6d9c06b37194fbc9025..0db103302ed0869fbc2c8170ec124d9b34645f4a 100644 (file)
@@ -14,11 +14,16 @@ public class SleepSensors {
        private String sleeping = "sleeping"
 
                
-       SleepSensors(Closure sendEvent, int deviceNumbers) {
+       SleepSensors(Closure sendEvent, int deviceNumbers, boolean init) {
                this.sendEvent = sendEvent              
                this.deviceNumbers = deviceNumbers
                this.sleepSensors = []
 
+               if (init) {
+                       this.sleeping = "sleeping"
+               } else {
+                       this.sleeping = "not sleeping"
+               }
                sleepSensors.add(new SleepSensor(id, label, displayName, this.sleeping))
        }