1 //Create a class for aeon key fob
3 import Timer.SimulatedTimer
5 public class AeonKeyFobs {
6 private int deviceNumbers
7 private List aeonKeyFobs
10 //For one device(We cannot have obj.id)-> We should have obj[0].id
11 private String id = "aeonKeyFobID0"
12 private String label = "aeonKeyFob0"
13 private String displayName = "aeonKeyFob0"
16 AeonKeyFobs(Closure sendEvent, int deviceNumbers) {
17 this.sendEvent = sendEvent
18 this.deviceNumbers = deviceNumbers
21 aeonKeyFobs.add(new AeonKeyFob(id, label, displayName))
25 def setValue(LinkedHashMap eventDataMap) {
26 aeonKeyFobs[0].setValue(eventDataMap)
27 sendEvent(eventDataMap)
30 //Methods for closures
31 def count(Closure Input) {
32 aeonKeyFobs.count(Input)
37 def each(Closure Input) {
38 aeonKeyFobs.each(Input)
40 def sort(Closure Input) {
41 aeonKeyFobs.sort(Input)
43 def find(Closure Input) {
44 aeonKeyFobs.find(Input)
46 def collect(Closure Input) {
47 aeonKeyFobs.collect(Input)
52 def eventsSince(Date dateObj) {
53 return aeonKeyFobs[0].eventsSince()