Adding path explorations for initializations.
[smartthings-infrastructure.git] / DoorControl / DoorControls.groovy
index 921089977d70655e594c2363ba63bf9cc519dc21..444154da8319bd8a20615aaf75e59e02c4d15137 100644 (file)
@@ -2,6 +2,9 @@
 package DoorControl
 import Timer.SimulatedTimer
 
+//JPF's Verify API
+import gov.nasa.jpf.vm.Verify
+
 public class DoorControls {
        int deviceNumbers       
        List doorControls
@@ -20,7 +23,15 @@ public class DoorControls {
                this.timers = new SimulatedTimer()
                this.deviceNumbers = deviceNumbers
                this.doorControls = []
-               
+
+               def init = Verify.getBoolean()
+               if (init) {
+                       this.doorState = "closed"
+                       this.doorLatestValue = "closed"
+               } else {
+                       this.doorState = "open"
+                       this.doorLatestValue = "open"
+               }
                doorControls.add(new DoorControl(sendEvent, id, label, displayName, this.doorState, this.doorLatestValue))
        }