Adding path explorations for initializations.
[smartthings-infrastructure.git] / ColorControl / ColorControls.groovy
index b3a6471926b18f34043c81a7353b6b470400070f..6eb5ac65f9f26a3e597cc07c72c7e9d86c9b86d1 100644 (file)
@@ -2,6 +2,8 @@
 package ColorControl
 import Timer.SimulatedTimer
 
+//JPF's Verify API
+import gov.nasa.jpf.vm.Verify
 
 public class ColorControls {
        private int deviceNumbers
@@ -21,6 +23,19 @@ public class ColorControls {
                this.sendEvent = sendEvent
                this.deviceNumbers = deviceNumbers
                this.colorControls = []
+               
+               def initHue = Verify.getIntFromList(30, 50, 70)
+               this.hue = initHue
+               def initSat = Verify.getIntFromList(40, 50, 60)
+               this.saturation = initSat
+               def init = Verify.getInt(0,2)
+               if (init == 0) {
+                       this.color = "red"
+               } else if (init == 1) {
+                       this.color = "green"
+               } else {
+                       this.color = "blue"
+               }
 
                colorControls.add(new ColorControl(id, label, displayName, this.color, this.hue, this.saturation))
        }