Merge branch 'master' of ssh://plrg.eecs.uci.edu/home/git/smartthings-infrastructure
[smartthings-infrastructure.git] / Switch / Switches.groovy
index 36ba2de02918205039019e374806ad975c3f98ee..d396b900d05ca2020462c3ec5b1ccdb9b1b171b4 100644 (file)
@@ -39,6 +39,19 @@ public class Switches {
                        this.switchLatestValue = "on"
                }
 
+               def initLevel = Verify.getIntFromList(30, 50, 70)
+               this.currentLevel = initLevel
+               def init = Verify.getBoolean()
+               if (init) {
+                       this.switchState = "off"
+                       this.currentSwitch = "off"
+                       this.switchLatestValue = "off"
+               } else {
+                       this.switchState = "on"
+                       this.currentSwitch = "on"
+                       this.switchLatestValue = "on"
+               }
+
                switches.add(new Switch(sendEvent, id, label, displayName, this.switchState, this.currentSwitch, this.currentLevel, this.switchLatestValue))
        }