Infrastructure compatible with swiches
[smartthings-infrastructure.git] / SmartThing / SmartThings.groovy
index 4ac188d5b90c68fe962ecdd68a0232dd66219143..f2cc9e70a7e7010ffe8330be86bd3ce6f14c3862 100644 (file)
@@ -1,7 +1,7 @@
 //Create a class for SmartThings
 package SmartThing
 
-class SmartThings {
+public class SmartThings {
        List smartThings = new ArrayList()
 
        // Methods for closures
@@ -30,6 +30,10 @@ class SmartThings {
        }
 
        // Methods to handle events
+       def eventsSince(Date dateObj, LinkedHashMap info) {
+               return smartThings[0].eventsSince()
+       }
+
        def eventsSince(Date dateObj) {
                return smartThings[0].eventsSince()
        }
@@ -39,9 +43,11 @@ class SmartThings {
        }
 
        // Methods to return states of the devices
-       def getProperty(String currentProperty) {
+       def propertyMissing(String currentProperty) {
+               if (smartThings[0] == null)
+                       return
                List tmpValues = new ArrayList()
-               tmpValues.add(smartThings[0].getProperty(currentProperty))
+               tmpValues.add(smartThings[0].propertyMissing(currentProperty))
                return tmpValues
        }