Changing Verify API call scheme for device handlers.
[smartthings-infrastructure.git] / Switch / Switches.groovy
index a13030a7d71a216344c9edb2fa50677d4189c5fd..e6ac8646571f6c4580146f0cb8a2fb08f22339d1 100644 (file)
@@ -2,9 +2,6 @@
 package Switch
 import Timer.SimulatedTimer
 
-//JPF's Verify API
-import gov.nasa.jpf.vm.Verify
-
 public class Switches {
        int deviceNumbers       
        List switches
@@ -20,25 +17,23 @@ public class Switches {
        private int currentLevel = 50
        private String switchLatestValue = "off"
 
-       Switches(Closure sendEvent, int deviceNumbers) {
+       Switches(Closure sendEvent, int deviceNumbers, boolean init) {
                this.sendEvent = sendEvent
                this.timers = new SimulatedTimer()
                this.deviceNumbers = deviceNumbers
                this.switches = []
 
-               def initLevel = Verify.getIntFromList(30, 50, 70)
-               this.currentLevel = initLevel
-               def init = Verify.getBoolean()
-               /*if (init) {
+               if (init) {
                        this.switchState = "off"
                        this.currentSwitch = "off"
                        this.switchLatestValue = "off"
+                       this.currentLevel = 50
                } else {
                        this.switchState = "on"
                        this.currentSwitch = "on"
                        this.switchLatestValue = "on"
-               }*/
-
+                       this.currentLevel = 60
+               }
                switches.add(new Switch(sendEvent, id, label, displayName, this.switchState, this.currentSwitch, this.currentLevel, this.switchLatestValue))
        }