Updating classes with Verify API.
[smartthings-infrastructure.git] / SwitchLevel / SwitchLevels.groovy
index 35c4ad9669d21dbeab9a5b4e8b5b2de7c7836c7f..3990109beda158ce7c7af3aa06938cefe72d4f74 100644 (file)
@@ -2,6 +2,9 @@
 package SwitchLevel
 import Timer.SimulatedTimer
 
+//JPF's Verify API
+import gov.nasa.jpf.vm.Verify
+
 public class SwitchLevels {
        int deviceNumbers       
        List switchLevels
@@ -24,6 +27,18 @@ public class SwitchLevels {
                this.deviceNumbers = deviceNumbers
                this.switchLevels = []
 
+               def initLevel = Verify.getIntFromList(30, 50, 70)
+               this.level = 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"
+               }
                switchLevels.add(new SwitchLevel(sendEvent, id, label, displayName, this.level, this.switchState, this.switchLatestValue))
        }