X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=SwitchLevel%2FSwitchLevels.groovy;h=075fc44ca8c2da988330712da154f249f7533713;hb=2d26e7af07daad1394408bdcf76150b5aacf3a8a;hp=c48e1cf4bd64a1ce261555cdef53a8a8b7738f55;hpb=83071d3bcfc33f015ece13868342644498a9dda3;p=smartthings-infrastructure.git diff --git a/SwitchLevel/SwitchLevels.groovy b/SwitchLevel/SwitchLevels.groovy index c48e1cf..075fc44 100644 --- a/SwitchLevel/SwitchLevels.groovy +++ b/SwitchLevel/SwitchLevels.groovy @@ -2,9 +2,6 @@ package SwitchLevel import SmartThing.SmartThings -//Importing mutable integer class -import MutableInteger.MutableInteger - public class SwitchLevels extends SmartThings { List switchLevels = new ArrayList() @@ -13,15 +10,15 @@ public class SwitchLevels extends SmartThings { switchLevels = smartThings // Initialization - StringBuilder id = new StringBuilder("switchLevelID0") - StringBuilder label = new StringBuilder("switchLevel") - StringBuilder displayName = new StringBuilder("switchLevel0") - MutableInteger level = new MutableInteger() + String id = "switchLevelID0" + String label = "level" + String displayName = "switchLevel" + Integer level if (init) - level.setValue(50) + level = 50 else - level.setValue(60) + level = 60 switchLevels.add(new SwitchLevel(sendEvent, id, label, displayName, level)) } @@ -38,11 +35,4 @@ public class SwitchLevels extends SmartThings { def setLevel(int newValue) { switchLevels[0].setLevel(newValue) } - - // Methods to return values - def getCurrentLevel() { - List tmpValues = new ArrayList() - tmpValues.add(switchLevels[0].getCurrentLevel()) - return tmpValues - } }