From b7cf952d275d7cb67250c52404cf855ef57c1119 Mon Sep 17 00:00:00 2001 From: rtrimana Date: Sat, 3 Aug 2019 22:29:52 -0700 Subject: [PATCH] Adding Verify API in color related classes. --- ColorControl/ColorControls.groovy | 8 +++----- ColorTemperature/ColorTemperatures.groovy | 11 +++++++++++ run.sh | 4 +++- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/ColorControl/ColorControls.groovy b/ColorControl/ColorControls.groovy index 5122f6b..0c0832b 100644 --- a/ColorControl/ColorControls.groovy +++ b/ColorControl/ColorControls.groovy @@ -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)) } diff --git a/ColorTemperature/ColorTemperatures.groovy b/ColorTemperature/ColorTemperatures.groovy index 952bfcd..aea5279 100644 --- a/ColorTemperature/ColorTemperatures.groovy +++ b/ColorTemperature/ColorTemperatures.groovy @@ -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 d77af37..675c82d 100755 --- 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 -- 2.34.1