Fixing bugs in infrastructure
[smartthings-infrastructure.git] / SmartThing / SmartThings.groovy
index 4ac188d5b90c68fe962ecdd68a0232dd66219143..3e1d4e059bc33d5b62ebba760eccdeea60b93a7c 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
@@ -39,7 +39,9 @@ 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))
                return tmpValues