Adding Verify API in color related classes.
authorrtrimana <rtrimana@uci.edu>
Sun, 4 Aug 2019 05:29:52 +0000 (22:29 -0700)
committerrtrimana <rtrimana@uci.edu>
Sun, 4 Aug 2019 05:29:52 +0000 (22:29 -0700)
ColorControl/ColorControls.groovy
ColorTemperature/ColorTemperatures.groovy
run.sh

index 5122f6b9b55f9150f3a6a8a51202c341499c73c6..0c0832b3921e650d870b2db8814bd212f4106a9b 100644 (file)
@@ -31,18 +31,16 @@ public class ColorControls {
                this.deviceNumbers = deviceNumbers
                this.colorControls = []
 
-               /*def initHue = Verify.getIntFromList(30, 50, 70)
+               def initHue = Verify.getIntFromList(30, 50)
                this.hue = initHue
-               def initSat = Verify.getIntFromList(40, 50, 60)
+               def initSat = Verify.getIntFromList(40, 50)
                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(sendEvent, id, label, displayName, this.color, this.hue, this.saturation, this.level, this.currentSwitch, this.colorTemperature))
        }
index 952bfcd86759678e50453bf4d3fa40c3cfc58205..aea527995d14b286e5f23ca21ebca1574d0cab9b 100644 (file)
@@ -25,6 +25,17 @@ public class ColorTemperatures {
                this.deviceNumbers = deviceNumbers
                this.colorTemperatues = []
 
+               def initLevel = Verify.getIntFromList(50, 70)
+               this.level = initLevel 
+               def initTemp = Verify.getIntFromList(10000, 15000)
+               this.colorTemperature = initTemp 
+               def init = Verify.getBoolean
+               if (init) {
+                       this.currentSwitch = "off"
+               } else {
+                       this.currentSwitch = "on"
+               }
+
                colorTemperatues.add(new ColorTemperature(sendEvent, id, label, displayName, this.level, this.currentSwitch, this.colorTemperature))
        }
 
diff --git a/run.sh b/run.sh
index d77af37608a2679ba4ecc430cbca06b17162cb3f..675c82d8937e8121aed09e00ac8d6d5a74a0c91c 100755 (executable)
--- a/run.sh
+++ b/run.sh
@@ -1,7 +1,9 @@
 #!/bin/bash
 
 # Device conflict
-python ModelCheck.py ../jpf-core/ ../logs/thermostats/ ../smartapps/ appLists/device-interaction/thermostatsAppList appLists/device-interaction/thermostatsAppList2
+python ModelCheck.py ../jpf-core/ ../logs/nonHueLights/ ../smartapps/ appLists/device-interaction/nonHueLightsAppList
+#python ModelCheck.py ../jpf-core/ ../logs/hueLights/ ../smartapps/ appLists/device-interaction/hueLightsAppList
+#python ModelCheck.py ../jpf-core/ ../logs/thermostats/ ../smartapps/ appLists/device-interaction/thermostatsAppList appLists/device-interaction/thermostatsAppList2
 #python ModelCheck.py ../jpf-core/ ../logs/alarms/ ../smartapps/ appLists/device-interaction/alarmsAppList appLists/device-interaction/alarmsAppList2
 #python ModelCheck.py ../jpf-core/ ../logs/locks/ ../smartapps/ appLists/device-interaction/locksAppList appLists/device-interaction/locksAppList2
 #python ModelCheck.py ../jpf-core/ ../logs/musicPlayers/ ../smartapps/ appLists/device-interaction/musicPlayersAppList