- if (init) {
- this.alarmState = "armed"
- } else {
- this.alarmState = "not armed"
- }
- imageCaptureSensors.add(new ImageCapture(id, label, displayName, this.image, this.alarmState))
- }
-
-
- //Methods for closures
- def count(Closure Input) {
- imageCaptureSensors.count(Input)
- }
- def size() {
- imageCaptureSensors.size()
- }
- def each(Closure Input) {
- imageCaptureSensors.each(Input)
- }
- def find(Closure Input) {
- imageCaptureSensors.find(Input)
- }
- def sort(Closure Input) {
- imageCaptureSensors.sort(Input)
- }
- def collect(Closure Input) {
- imageCaptureSensors.collect(Input)
- }
-
- def alarmOn() {
- if (alarmState != "armed") {
- this.alarmState = "armed"
- imageCaptureSensors[0].alarmOn()
- }
- }
-
- def alarmOff() {
- if (alarmState != "not armed") {
- this.alarmState = "not armed"
- imageCaptureSensors[0].alarmOff()
- }
+ imageCaptureSensors.add(new ImageCapture(sendEvent, id, label, displayName, image))