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))
}
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))
}
'thermostatFanMode' : 5,
'thermostatOperatingState' : 5,
'switch' : 2,
+ 'switch.on' : 1,
+ 'switch.off' : 1,
'location' : 3,
'mode' : 3,
'acceleration' : 2,
extractedEvents.write(line)
event.close()
elif eventList[i] == "unlock":
- event = open("eventSimulator/unlockEvent.groovy", "r")
- for line in event:
- extractedEvents.write(line)
- event.close()
+ #Don't do anything for this case
+ counter = counter - 1
elif eventList[i] == "contact.open":
event = open("eventSimulator/contactOpenEvent.groovy", "r")
for line in event:
event.close()
elif eventList[i] == "doorState":
#Write two events subsequently
- extractedEvents.write("\t\t\tdef event = Verify.getInt(0,1)\n")
- extractedEvents.write("\t\t\tif (event == 0) {\n")
event = open("eventSimulator/doorOpenEvent.groovy", "r")
for line in event:
extractedEvents.write(line)
event = open("eventSimulator/relaySwitchOnEvent.groovy", "r")
elif capability == "capability.colorControl":
event = open("eventSimulator/colorControlSwitchOnEvent.groovy", "r")
+ elif capability == "capability.colorTemperature":
+ event = open("eventSimulator/colorTemperatureSwitchOnEvent.groovy", "r")
for line in event:
extractedEvents.write(line)
event.close()
event = open("eventSimulator/relaySwitchOffEvent.groovy", "r")
elif capability == "capability.colorControl":
event = open("eventSimulator/colorControlSwitchOffEvent.groovy", "r")
+ elif capability == "capability.colorTemperature":
+ event = open("eventSimulator/colorTemperatureSwitchOffEvent.groovy", "r")
+ for line in event:
+ extractedEvents.write(line)
+ event.close()
+ elif eventList[i] == "switch.on":
+ #Check which capability
+ variable = eventVarMap[eventList[i]]
+ if eventList[i] not in eventVarCounterMap.keys():
+ eventVarCounterMap[eventList[i]] = 1
+ eventVarCount = 0
+ else:
+ eventVarCount = eventVarCounterMap[eventList[i]]
+ eventVarCounterMap[eventList[i]] = eventVarCount + 1
+ capability = capabilityMap[variable[eventVarCount]]
+ #Write two events subsequently
+ if capability == "capability.switch":
+ event = open("eventSimulator/switchOnDefaultEvent.groovy", "r")
+ elif capability == "capability.switchLevel":
+ event = open("eventSimulator/switchLevelOnDefaultEvent.groovy", "r")
+ elif capability == "capability.relaySwitch":
+ event = open("eventSimulator/relaySwitchOnDefaultEvent.groovy", "r")
+ elif capability == "capability.colorControl":
+ event = open("eventSimulator/colorControlSwitchOnDefaultEvent.groovy", "r")
+ elif capability == "capability.colorTemperature":
+ event = open("eventSimulator/colorTemperatureSwitchOnDefaultEvent.groovy", "r")
+ for line in event:
+ extractedEvents.write(line)
+ event.close()
+ elif eventList[i] == "switch.off":
+ #Check which capability
+ variable = eventVarMap[eventList[i]]
+ if eventList[i] not in eventVarCounterMap.keys():
+ eventVarCounterMap[eventList[i]] = 1
+ eventVarCount = 0
+ else:
+ eventVarCount = eventVarCounterMap[eventList[i]]
+ eventVarCounterMap[eventList[i]] = eventVarCount + 1
+ capability = capabilityMap[variable[eventVarCount]]
+ #Write two events subsequently
+ if capability == "capability.switch":
+ event = open("eventSimulator/switchOffDefaultEvent.groovy", "r")
+ elif capability == "capability.switchLevel":
+ event = open("eventSimulator/switchLevelOffDefaultEvent.groovy", "r")
+ elif capability == "capability.relaySwitch":
+ event = open("eventSimulator/relaySwitchOffDefaultEvent.groovy", "r")
+ elif capability == "capability.colorControl":
+ event = open("eventSimulator/colorControlSwitchOffDefaultEvent.groovy", "r")
+ elif capability == "capability.colorTemperature":
+ event = open("eventSimulator/colorTemperatureSwitchOffDefaultEvent.groovy", "r")
for line in event:
extractedEvents.write(line)
event.close()
event = open("eventSimulator/musicPlayerLevelEvent.groovy", "r")
elif capability == "capability.switchLevel":
event = open("eventSimulator/switchLevelEvent.groovy", "r")
+ elif capability == "capability.colorControl":
+ event = open("eventSimulator/colorLevelChangeEvent.groovy", "r")
for line in event:
extractedEvents.write(line)
event.close()
Out.write("\n")
Out.write("@Field def app1\n")
Out.write("@Field def app2\n")
-Out.write("def initOrder = Verify.getBoolean()\n")
-Out.write("if (initOrder) {\n")
+Out.write("//def initOrder = Verify.getBoolean()\n")
+Out.write("//if (initOrder) {\n")
Out.write("\tapp1 = new App1(this)\n")
Out.write("\tapp2 = new App2(this)\n")
-Out.write("} else {\n")
-Out.write("\tapp2 = new App2(this)\n")
-Out.write("\tapp1 = new App1(this)\n")
-Out.write("}\n\n")
-Out.write("def installOrder = Verify.getBoolean()\n")
-Out.write("if (installOrder) {\n")
+Out.write("//} else {\n")
+Out.write("\t//app2 = new App2(this)\n")
+Out.write("\t//app1 = new App1(this)\n")
+Out.write("//}\n\n")
+Out.write("//def installOrder = Verify.getBoolean()\n")
+Out.write("//if (installOrder) {\n")
Out.write("\tapp1.installed()\n")
Out.write("\tapp2.installed()\n")
-Out.write("} else {\n")
-Out.write("\tapp2.installed()\n")
-Out.write("\tapp1.installed()\n")
-Out.write("}\n\n")
+Out.write("//} else {\n")
+Out.write("\t//app2.installed()\n")
+Out.write("\t//app1.installed()\n")
+Out.write("//}\n\n")
for line in eventSimulator:
Out.write(line)
Out.close()
this.deviceNumbers = deviceNumbers
this.thermostats = []
- /*def initTemperature = Verify.getIntFromList(60, 66, 70)
+ def initTemperature = Verify.getIntFromList(60, 66)
this.temperature = initTemperature
this.currentTemperature = initTemperature
- def initCoolingSetpoint = Verify.getIntFromList(70, 80, 90)
+ def initCoolingSetpoint = Verify.getIntFromList(70, 80)
this.currentCoolingSetpoint = initCoolingSetpoint
this.coolingSetpoint = initCoolingSetpoint
- def initHeatingSetpoint = Verify.getIntFromList(20, 35, 50)
+ def initHeatingSetpoint = Verify.getIntFromList(35, 50)
this.currentHeatingSetpoint = initHeatingSetpoint
this.heatingSetpoint = initHeatingSetpoint
- def initThermostatSetpoint = Verify.getIntFromList(50, 60, 70)
+ def initThermostatSetpoint = Verify.getIntFromList(50, 60)
this.thermostatSetpoint = initThermostatSetpoint
def initFanMode = Verify.getInt(0,4)
this.thermostatMode = "off"
this.currentThermostatMode = "off"
this.thermostatLatestMode = "off"
- }*/
+ }
thermostats.add(new Thermostat(sendEvent, id, label, displayName, this.temperature, this.currentCoolingSetpoint,
this.currentHeatingSetpoint, this.coolingSetpoint, this.thermostatSetpoint, this.heatingSetpoint, this.coolingSetpointRange,
--- /dev/null
+ colorControlObject.setValue([name: "switch.off", value: "off", deviceId: "colorControlID0", descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
\ No newline at end of file
--- /dev/null
+ colorControlObject.setValue([name: "switch.on", value: "on", deviceId: "colorControlID0", descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
\ No newline at end of file
--- /dev/null
+ colorTemperatureObject.setValue([name: "switch.off", value: "off", deviceId: "switchID0", descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
\ No newline at end of file
--- /dev/null
+ colorTemperatureObject.setValue([name: "switch", value: "off", deviceId: "switchID0", descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
\ No newline at end of file
--- /dev/null
+ colorTemperatureObject.setValue([name: "switch.on", value: "on", deviceId: "switchID0", descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
\ No newline at end of file
--- /dev/null
+ colorTemperatureObject.setValue([name: "switch", value: "on", deviceId: "switchID0", descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
\ No newline at end of file
--- /dev/null
+ relaySwitchObject.setValue([name: "switch.off", value: "off", deviceId: "relaySwitchID0", descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
\ No newline at end of file
--- /dev/null
+ relaySwitchObject.setValue([name: "switch.on", value: "on", deviceId: "relaySwitchID0", descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
\ No newline at end of file
switchLevelObject.setValue([name: "level", value: "45"/*A number between 0 to 100*/, deviceId: "switchLevelID0", descriptionText: "",
- displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
\ No newline at end of file
--- /dev/null
+ switchLevelObject.setValue([name: "switch.off", value: "off", deviceId: "switchLevelID0", descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
\ No newline at end of file
--- /dev/null
+ switchLevelObject.setValue([name: "switch.on", value: "on", deviceId: "switchLevelID0", descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
\ No newline at end of file
--- /dev/null
+ switchObject.setValue([name: "switch.off", value: "off", deviceId: "switchID0", descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
\ No newline at end of file
--- /dev/null
+ switchObject.setValue([name: "switch.on", value: "on", deviceId: "switchID0", descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
\ No newline at end of file
#!/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 appLists/device-interaction/nonHueLightsAppList2
+#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