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))
}
//By Model Checker
def setValue(LinkedHashMap eventDataMap) {
if (eventDataMap["value"] != sleepSensors[0].sleeping) {
+ this.sleeping = eventDataMap["value"]
sleepSensors[0].setValue(eventDataMap["value"])
- this.sleeping = sleepSensors[0].sleeping
sendEvent(eventDataMap)
}
}
def find(Closure Input) {
sleepSensors.find(Input)
}
+ def sort(Closure Input) {
+ sleepSensors.sort(Input)
+ }
def collect(Closure Input) {
sleepSensors.collect(Input)
}