Adding new devices into run.sh.
[smartthings-infrastructure.git] / SwitchLevel / SwitchLevels.groovy
index 09bf7a6f163c480949b40dc5b5a48681f168a625..5d02053b334ebdea6aaaf85cc78608b8866e0dc8 100644 (file)
@@ -2,9 +2,6 @@
 package SwitchLevel
 import Timer.SimulatedTimer
 
-//JPF's Verify API
-import gov.nasa.jpf.vm.Verify
-
 public class SwitchLevels {
        int deviceNumbers       
        List switchLevels
@@ -23,24 +20,29 @@ public class SwitchLevels {
        private String currentSwitch = "on"
        private String switchLatestValue = "on"
 
-       SwitchLevels(Closure sendEvent, int deviceNumbers) {
+       SwitchLevels(Closure sendEvent, int deviceNumbers, boolean init) {
                this.sendEvent = sendEvent
                this.timers = new SimulatedTimer()
                this.deviceNumbers = deviceNumbers
                this.switchLevels = []
 
-               /*def initLevel = Verify.getIntFromList(30, 50, 70)
-               this.level = initLevel
-               def init = Verify.getBoolean()
                if (init) {
+                       this.level = 50
+                       this.rate = 50
+                       this.hue = 30
+                       this.saturation = 70
                        this.switchState = "off"
                        this.currentSwitch = "off"
                        this.switchLatestValue = "off"
                } else {
+                       this.level = 60
+                       this.rate = 60
+                       this.hue = 50
+                       this.saturation = 90
                        this.switchState = "on"
                        this.currentSwitch = "on"
                        this.switchLatestValue = "on"
-               }*/
+               }
                switchLevels.add(new SwitchLevel(sendEvent, id, label, displayName, this.level, this.hue, this.saturation, this.switchState, this.switchLatestValue))
        }