X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=Switch%2FSwitches.groovy;fp=Switch%2FSwitches.groovy;h=4729adf4e59840c404be776750c746f2915035b2;hb=2d26e7af07daad1394408bdcf76150b5aacf3a8a;hp=a71a49f0b355ca75cefa29d333d57cabf50197d6;hpb=83071d3bcfc33f015ece13868342644498a9dda3;p=smartthings-infrastructure.git diff --git a/Switch/Switches.groovy b/Switch/Switches.groovy index a71a49f..4729adf 100644 --- a/Switch/Switches.groovy +++ b/Switch/Switches.groovy @@ -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 - } }