while (Temp != "\"" and Temp != "app" and Temp != "location"):
Temp = GetToken(F)
if Temp == "\"":
- Temp = GetToken(F)
- #print "DEBUG: %s" % variable
- #print capabilityMap
- #print eventList
- #if variable == "app" or variable == "location":
-
+ Temp = GetToken(F)
if Temp == "app" or Temp == "location":
if Temp not in eventList:
eventList.append(Temp)
- elif variable in capabilityMap.keys() and capabilityMap[variable] not in capabilityList:
+ elif Temp not in eventList or (variable in capabilityMap.keys() and capabilityMap[variable] not in capabilityList):
# We do not repeat the same capability twice
capability = capabilityMap[variable]
capabilityList.append(capability)
listOfEvents.append(variable)
else:
eventVarMap[Temp] = [variable]
-
+ #print "DEBUG: %s - %s" % (variable, Temp)
+ #print capabilityMap
+ #print eventList
+
#Check and analyze capabilities for physical interaction
AnalyzeCapabilities(Temp, appName, F)
AnalyzePhysicalInteraction(app1Capabilities, app2Capabilities)
AnalyzePhysicalInteraction(app2Capabilities, app1Capabilities)
-
def AnalyzeCapabilities(Temp, appName, F):
#Illuminance related
if (Temp == "capability.switch" or
for line in event:
extractedEvents.write("\t\t" + line)
event.close()
- if capability == "capability.presenceSensor":
- extractedEvents.write("\t\t\t} else {\n")
- event = open("eventSimulator/presencePresencePresentEvent.groovy", "r")
- for line in event:
- extractedEvents.write("\t\t" + line)
- event.close()
- extractedEvents.write("\t\t\t}\n")
+ elif eventList[i] == "presence.present": #Case for Touched event
+ event = open("eventSimulator/presencePresencePresentEvent.groovy", "r")
+ for line in event:
+ extractedEvents.write("\t\t" + line)
+ event.close()
elif eventList[i] == "doorState":
#Write two events subsequently
extractedEvents.write("\t\t\tdef event = Verify.getInt(0,1)\n")
lockObject.setValue([name: "lock", value: "locked", deviceId: "lockID0", descriptionText: "",
- displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
\ No newline at end of file
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])