Fixing bugs in infra
authorSeyed Amir Hossein Aqajari <saqajari@circinus-3.ics.uci.edu>
Wed, 22 Jan 2020 20:39:33 +0000 (12:39 -0800)
committerSeyed Amir Hossein Aqajari <saqajari@circinus-3.ics.uci.edu>
Wed, 22 Jan 2020 20:39:33 +0000 (12:39 -0800)
Extractor/Extractor.groovy
Lock/Locks.groovy
MobilePresence/MobilePresence.groovy
eventSimulator/beaconLeftEvent.groovy
eventSimulator/beaconPresentEvent.groovy

index 15edc66c3c1f91349e03a4d7f873766a5048f25f..ebef89e3b83388718c6a74b0813bba61fdd370ac 100644 (file)
@@ -506,22 +506,22 @@ def input(LinkedHashMap metaData) {
                        }
 
                        if (contains == 0)
                        }
 
                        if (contains == 0)
-                               globalObjects.append("@Field def buttonObject = new Buttons(sendEvent, init)\n")
+                               globalObjects.append("@Field def buttonObject = new Buttons(sendEvent)\n")
 
                        if (buttonObjects == 0) {
                                buttonObject0 = metaData['name']
 
                        if (buttonObjects == 0) {
                                buttonObject0 = metaData['name']
-                               this[buttonObject0] = new Buttons({}, true)
+                               this[buttonObject0] = new Buttons({})
                        } else if (buttonObjects == 1) {
                                buttonObject1 = metaData['name']
                        } else if (buttonObjects == 1) {
                                buttonObject1 = metaData['name']
-                               this[buttonObject1] = new Buttons({}, true)
+                               this[buttonObject1] = new Buttons({})
                        } else if (buttonObjects == 2) {
                                buttonObject2 = metaData['name']
                        } else if (buttonObjects == 2) {
                                buttonObject2 = metaData['name']
-                               this[buttonObject2] = new Buttons({}, true)
+                               this[buttonObject2] = new Buttons({})
                        }
 
                        buttonObjects=buttonObjects+1
 
                        }
 
                        buttonObjects=buttonObjects+1
 
-                       settings.put(metaData['name'], new Buttons({}, true))
+                       settings.put(metaData['name'], new Buttons({}))
 
                        if (App == "App1") {
                                extractedObjectsApp1.append("//Object for class Button!\n")
 
                        if (App == "App1") {
                                extractedObjectsApp1.append("//Object for class Button!\n")
@@ -926,22 +926,22 @@ def input(LinkedHashMap metaData) {
                        }
 
                        if (contains == 0)
                        }
 
                        if (contains == 0)
-                               globalObjects.append("@Field def momentaryObject = new Momentaries(sendEvent, 1)\n")
+                               globalObjects.append("@Field def momentaryObject = new Momentaries(sendEvent)\n")
 
                        if (momentaryObjects == 0) {
                                momentaryObject0 = metaData['name']
 
                        if (momentaryObjects == 0) {
                                momentaryObject0 = metaData['name']
-                               this[momentaryObject0] = new Momentaries({}, 1)
+                               this[momentaryObject0] = new Momentaries({})
                        } else if (momentaryObjects == 1) {
                                momentaryObject1 = metaData['name']
                        } else if (momentaryObjects == 1) {
                                momentaryObject1 = metaData['name']
-                               this[momentaryObject1] = new Momentaries({}, 1)
+                               this[momentaryObject1] = new Momentaries({})
                        } else if (momentaryObjects == 2) {
                                momentaryObject2 = metaData['name']
                        } else if (momentaryObjects == 2) {
                                momentaryObject2 = metaData['name']
-                               this[momentaryObject2] = new Momentaries({}, 1)
+                               this[momentaryObject2] = new Momentaries({})
                        }
 
                        momentaryObjects=momentaryObjects+1
 
                        }
 
                        momentaryObjects=momentaryObjects+1
 
-                       settings.put(metaData['name'], new Momentaries({}, 1))
+                       settings.put(metaData['name'], new Momentaries({}))
 
                        if (App == "App1") {
                                extractedObjectsApp1.append("//Object for class momentory switch class!\n")
 
                        if (App == "App1") {
                                extractedObjectsApp1.append("//Object for class momentory switch class!\n")
@@ -1521,22 +1521,22 @@ def input(LinkedHashMap metaData) {
                        }
 
                        if (contains == 0)
                        }
 
                        if (contains == 0)
-                               globalObjects.append("@Field def touchSensorObject = new NfcTouch(sendEvent, 1)\n")
+                               globalObjects.append("@Field def touchSensorObject = new NfcTouch(sendEvent)\n")
 
                        if (touchSensorObjects == 0) {
                                touchSensorObject0 = metaData['name']
 
                        if (touchSensorObjects == 0) {
                                touchSensorObject0 = metaData['name']
-                               this[touchSensorObject0] = new NfcTouch({}, 1)
+                               this[touchSensorObject0] = new NfcTouch({})
                        } else if (touchSensorObjects == 1) {
                                touchSensorObject1 = metaData['name']
                        } else if (touchSensorObjects == 1) {
                                touchSensorObject1 = metaData['name']
-                               this[touchSensorObject1] = new NfcTouch({}, 1)
+                               this[touchSensorObject1] = new NfcTouch({})
                        } else if (touchSensorObjects == 2) {
                                touchSensorObject2 = metaData['name']
                        } else if (touchSensorObjects == 2) {
                                touchSensorObject2 = metaData['name']
-                               this[touchSensorObject2] = new NfcTouch({}, 1)
+                               this[touchSensorObject2] = new NfcTouch({})
                        }
 
                        touchSensorObjects=touchSensorObjects+1
 
                        }
 
                        touchSensorObjects=touchSensorObjects+1
 
-                       settings.put(metaData['name'], new NfcTouch({}, 1))
+                       settings.put(metaData['name'], new NfcTouch({}))
 
                        if (App == "App1") {
                                extractedObjectsApp1.append("//Object for class Touch Sensor!\n")
 
                        if (App == "App1") {
                                extractedObjectsApp1.append("//Object for class Touch Sensor!\n")
@@ -1591,22 +1591,22 @@ def input(LinkedHashMap metaData) {
                        }
 
                        if (contains == 0)
                        }
 
                        if (contains == 0)
-                               globalObjects.append("@Field def mobilePresenceObject = new MobilePresences(sendEvent, 1)\n")
+                               globalObjects.append("@Field def mobilePresenceObject = new MobilePresences(sendEvent)\n")
 
                        if (mobilePresenceObjects == 0) {
                                mobilePresenceObject0 = metaData['name']
 
                        if (mobilePresenceObjects == 0) {
                                mobilePresenceObject0 = metaData['name']
-                               this[mobilePresenceObject0] = new MobilePresences({}, 1)
+                               this[mobilePresenceObject0] = new MobilePresences({})
                        } else if (mobilePresenceObjects == 1) {
                                mobilePresenceObject1 = metaData['name']
                        } else if (mobilePresenceObjects == 1) {
                                mobilePresenceObject1 = metaData['name']
-                               this[mobilePresenceObject1] = new MobilePresences({}, 1)
+                               this[mobilePresenceObject1] = new MobilePresences({})
                        } else if (mobilePresenceObjects == 2) {
                                mobilePresenceObject2 = metaData['name']
                        } else if (mobilePresenceObjects == 2) {
                                mobilePresenceObject2 = metaData['name']
-                               this[mobilePresenceObject2] = new MobilePresences({}, 1)
+                               this[mobilePresenceObject2] = new MobilePresences({})
                        }
 
                        mobilePresenceObjects=mobilePresenceObjects+1
 
                        }
 
                        mobilePresenceObjects=mobilePresenceObjects+1
 
-                       settings.put(metaData['name'], new MobilePresences({}, 1))
+                       settings.put(metaData['name'], new MobilePresences({}))
 
                        if (App == "App1") {
                                extractedObjectsApp1.append("//Object for class mobile presence!\n")
 
                        if (App == "App1") {
                                extractedObjectsApp1.append("//Object for class mobile presence!\n")
@@ -1625,22 +1625,22 @@ def input(LinkedHashMap metaData) {
                                }
                        }
                        if (contains == 0)
                                }
                        }
                        if (contains == 0)
-                               globalObjects.append("@Field def aeonKeyFobObject = new AeonKeyFobs(sendEvent, 1)\n")
+                               globalObjects.append("@Field def aeonKeyFobObject = new AeonKeyFobs(sendEvent)\n")
 
                        if (aeonKeyFobObjects == 0) {
                                aeonKeyFobObject0 = metaData['name']
 
                        if (aeonKeyFobObjects == 0) {
                                aeonKeyFobObject0 = metaData['name']
-                               this[aeonKeyFobObject0] = new AeonKeyFobs({}, 1)
+                               this[aeonKeyFobObject0] = new AeonKeyFobs({})
                        } else if (aeonKeyFobObjects == 1) {
                                aeonKeyFobObject1 = metaData['name']
                        } else if (aeonKeyFobObjects == 1) {
                                aeonKeyFobObject1 = metaData['name']
-                               this[aeonKeyFobObject1] = new AeonKeyFobs({}, 1)
+                               this[aeonKeyFobObject1] = new AeonKeyFobs({})
                        } else if (aeonKeyFobObjects == 2) {
                                aeonKeyFobObject2 = metaData['name']
                        } else if (aeonKeyFobObjects == 2) {
                                aeonKeyFobObject2 = metaData['name']
-                               this[aeonKeyFobObject2] = new AeonKeyFobs({}, 1)
+                               this[aeonKeyFobObject2] = new AeonKeyFobs({})
                        }
 
                        aeonKeyFobObjects=aeonKeyFobObjects+1
 
                        }
 
                        aeonKeyFobObjects=aeonKeyFobObjects+1
 
-                       settings.put(metaData['name'], new AeonKeyFobs({}, 1)) 
+                       settings.put(metaData['name'], new AeonKeyFobs({})) 
 
                        if (App == "App1") {
                                extractedObjectsApp1.append("//Object for class aeon key fob!\n")
 
                        if (App == "App1") {
                                extractedObjectsApp1.append("//Object for class aeon key fob!\n")
@@ -2155,7 +2155,7 @@ def preferences(Closure inputData) {
                GlobalVariablesBothApps.append("//Creating Global variables for both apps\n")
                GlobalVariablesBothApps.append("@Field def sendEvent = {eventDataMap -> eventHandler(eventDataMap)}\n")
                GlobalVariablesBothApps.append("@Field def locationObject = new LocationVar(sendEvent, init)\n")
                GlobalVariablesBothApps.append("//Creating Global variables for both apps\n")
                GlobalVariablesBothApps.append("@Field def sendEvent = {eventDataMap -> eventHandler(eventDataMap)}\n")
                GlobalVariablesBothApps.append("@Field def locationObject = new LocationVar(sendEvent, init)\n")
-               GlobalVariablesBothApps.append("@Field def appObject = new Touched(sendEvent, 0)\n")
+               GlobalVariablesBothApps.append("@Field def appObject = new Touched(sendEvent)\n")
                
                globalObjects.withReader { reader ->
                        while ((line = reader.readLine()) != null) {
                
                globalObjects.withReader { reader ->
                        while ((line = reader.readLine()) != null) {
index d65e3f6033c2127bfc72ac9838766844133d3575..381bf2a44f4c1f4f9ccbb1d56d8dacffe2526adf 100644 (file)
@@ -2,12 +2,12 @@
 package Lock
 import SmartThing.SmartThings
 
 package Lock
 import SmartThing.SmartThings
 
-public class Locks extends SmartThing {
+public class Locks extends SmartThings {
        List locks = new ArrayList()
 
        Locks(Closure sendEvent, boolean init) {
                // Only initialize one time since we only have one device for each capability
        List locks = new ArrayList()
 
        Locks(Closure sendEvent, boolean init) {
                // Only initialize one time since we only have one device for each capability
-               thermostats = smartThings
+               locks = smartThings
 
                // Initialization
                StringBuilder id = new StringBuilder("lockID0")
 
                // Initialization
                StringBuilder id = new StringBuilder("lockID0")
index 4f9e4a9d5a28b42a6b6595d7519577b65a09145b..7e6ff0a7f6a02d5d4b3c3f6fd61d31c6f2a92010 100644 (file)
@@ -15,7 +15,6 @@ public class MobilePresence extends SmartThing {
 
        MobilePresence(Closure sendEvent, StringBuilder id, StringBuilder label, StringBuilder displayName, StringBuilder deviceNetworkId) {
                deviceValuesMap = deviceValueSmartThing
 
        MobilePresence(Closure sendEvent, StringBuilder id, StringBuilder label, StringBuilder displayName, StringBuilder deviceNetworkId) {
                deviceValuesMap = deviceValueSmartThing
-               deviceIntValuesMap = deviceIntValueSmartThing
                idSmartThing = id
                labelSmartThing = label
                displayNameSmartThing = displayName
                idSmartThing = id
                labelSmartThing = label
                displayNameSmartThing = displayName
index 445e51f7281b4f6b2add8e67125fbd5cf1677672..21a077c78acf8b974cedc31a7ad93312b594263f 100644 (file)
@@ -1,2 +1,2 @@
-                       beaconSensorObject.setValue([name: "presence", value: "not present", deviceId: "beaconSensorID0", descriptionText: "",
+                       beaconSensorObject[0].setValue([name: "presence", value: "not present", deviceId: "beaconSensorID0", descriptionText: "",
                                        displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"presence":"0","dni":"mobile0"}'])
                                        displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"presence":"0","dni":"mobile0"}'])
index 91739ccfc1a393a8808fe71e885d7d0c76b947c5..c09776d0b1cfe828595014e095d544d07dc04c91 100644 (file)
@@ -1,2 +1,2 @@
-                       beaconSensorObject.setValue([name: "presence", value: "present", deviceId: "beaconSensorID0", descriptionText: "",
+                       beaconSensorObject[0].setValue([name: "presence", value: "present", deviceId: "beaconSensorID0", descriptionText: "",
                                        displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"presence":"1","dni":"mobile0"}'])
                                        displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"presence":"1","dni":"mobile0"}'])