Removing getXXX methods + properties. Adding getProperty feature to SmartThing(s)
[smartthings-infrastructure.git] / AeonKeyFob / AeonKeyFobs.groovy
index 6383898b5538d9af16ea8f8fc0d6375d628b0d57..c3dd087c841cb4443064d0e1be52ce367f58ce7a 100644 (file)
@@ -1,63 +1,18 @@
 //Create a class for aeon key fob
 package AeonKeyFob
-import Timer.SimulatedTimer
+import SmartThing.SmartThings
 
-//JPF's Verify API
-import gov.nasa.jpf.vm.Verify
-
-public class AeonKeyFobs {
-       private int deviceNumbers
-       private List aeonKeyFobs
-       def sendEvent
-
-       //For one device(We cannot have obj.id)-> We should have obj[0].id
-       private String id = "aeonKeyFobID0"
-       private String label = "aeonKeyFob0"
-       private String displayName = "aeonKeyFob0"
-       
+public class AeonKeyFobs extends SmartThings {
+       List aeonKeyFobs = new ArrayList()
                
-       AeonKeyFobs(Closure sendEvent, int deviceNumbers) {
-               this.sendEvent = sendEvent              
-               this.deviceNumbers = deviceNumbers
-               this.aeonKeyFobs = []
-
-               aeonKeyFobs.add(new AeonKeyFob(id, label, displayName))
-       }
-
-       //By Model Checker
-       def setValue(LinkedHashMap eventDataMap) {
-               aeonKeyFobs[0].setValue(eventDataMap)
-               sendEvent(eventDataMap)
-       }
-
-       //Methods for closures
-       def count(Closure Input) {
-               aeonKeyFobs.count(Input)
-       }
-       def size() {
-               aeonKeyFobs.size()
-       }
-       def each(Closure Input) {
-               aeonKeyFobs.each(Input)
-       }
-       def sort(Closure Input) {
-               aeonKeyFobs.sort(Input)
-       }
-       def find(Closure Input) {
-               aeonKeyFobs.find(Input)
-       }
-       def collect(Closure Input) {
-               aeonKeyFobs.collect(Input)
-       }
-
-
-       //methods
-       def eventsSince(Date dateObj) {
-               return aeonKeyFobs[0].eventsSince()
-       }
-
+       AeonKeyFobs(Closure sendEvent) {
+               aeonKeyFobs = smartThings
+               
+               // Initialization
+               String id = "aeonKeyFobID0"
+               String label = "button"
+               String displayName = "aeonKeyFob"
 
-       def getAt(int ix) {
-               aeonKeyFobs[ix]
+               aeonKeyFobs.add(new AeonKeyFob(sendEvent, id, label, displayName))
        }
 }