Removing getXXX methods + properties. Adding getProperty feature to SmartThing(s)
[smartthings-infrastructure.git] / RelaySwitch / RelaySwitches.groovy
index 76420f37974338fdfa11f8592cdca6ab64fe8a50..bf89c2368a8ad4c54a194d11b96b8a444f371b92 100644 (file)
@@ -10,15 +10,15 @@ public class RelaySwitches extends SmartThings {
                relaySwitches = smartThings
 
                // Initialization
-               StringBuilder id = new StringBuilder("relaySwitchID0")
-               StringBuilder label = new StringBuilder("relaySwitch")
-               StringBuilder displayName = new StringBuilder("relaySwitch0")
-               StringBuilder currentSwitch = new StringBuilder()
+               String id = "relaySwitchID0"
+               String label = "switch"
+               String displayName = "relaySwitch"
+               String currentSwitch
 
                if (init)
-                       currentSwitch.append("off")
+                       currentSwitch = "off"
                else
-                       currentSwitch.append("on")
+                       currentSwitch = "on"
 
                relaySwitches.add(new RelaySwitch(sendEvent, id, label, displayName, currentSwitch))
        }
@@ -39,11 +39,4 @@ public class RelaySwitches extends SmartThings {
        def off(LinkedHashMap metaData) {
                off()
        }
-
-       // Methods to return values
-       def getCurrentSwitch() {
-               List tmpValues = new ArrayList()
-               tmpValues.add(relaySwitches[0].getCurrentSwitch())
-               return tmpValues
-       }
 }