Removing getXXX methods + properties. Adding getProperty feature to SmartThing(s)
[smartthings-infrastructure.git] / Switch / Switches.groovy
index a71a49f0b355ca75cefa29d333d57cabf50197d6..4729adf4e59840c404be776750c746f2915035b2 100644 (file)
@@ -9,15 +9,15 @@ public class Switches extends SmartThings {
                switches = smartThings
 
                // Initialization
-               StringBuilder id = new StringBuilder("switchID0")
-               StringBuilder label = new StringBuilder("switch")
-               StringBuilder displayName = new StringBuilder("switch0")
-               StringBuilder currentSwitch = new StringBuilder()
+               String id = "switchID0"
+               String label = "switch"
+               String displayName = "switch"
+               String currentSwitch
 
                if (init)
-                       currentSwitch.append("off")
+                       currentSwitch = "off"
                else
-                       currentSwitch.append("on")
+                       currentSwitch = "on"
 
                switches.add(new Switch(sendEvent, id, label, displayName, currentSwitch))
        }
@@ -38,11 +38,4 @@ public class Switches extends SmartThings {
        def off(LinkedHashMap metaData) {
                off()
        }
-
-       // Methods to return values
-       def getCurrentSwitch() {
-               List tmpValues = new ArrayList()
-               tmpValues.add(switches[0].getCurrentSwitch())
-               return tmpValues
-       }
 }