Fixing bugs in infrastructure
authorSeyed Amir Hossein Aqajari <saqajari@circinus-10.ics.uci.edu>
Wed, 29 Jan 2020 23:27:40 +0000 (15:27 -0800)
committerSeyed Amir Hossein Aqajari <saqajari@circinus-10.ics.uci.edu>
Wed, 29 Jan 2020 23:27:40 +0000 (15:27 -0800)
ColorControl/ColorControls.groovy
Location/LocationVar.groovy
Lock/Locks.groovy
MobilePresence/MobilePresences.groovy
MusicPlayer/MusicPlayer.groovy
SmartThing/SmartThing.groovy
SmartThing/SmartThings.groovy
Thermostat/Thermostats.groovy
appLists/device-interaction/locksAppList

index 68fd6f0..d17f9e4 100644 (file)
@@ -2,9 +2,6 @@
 package ColorControl
 import SmartThing.SmartThings
 
-//Importing mutable integer class
-import MutableInteger.MutableInteger
-
 public class ColorControls extends SmartThings {
        List colorControls = new ArrayList()
        
index 6a8e6d3..403055d 100755 (executable)
@@ -27,6 +27,7 @@ public class LocationVar extends SmartThing {
                        sendEventSmartThings = sendEvent
 
                        // Initialization
+                       String mode
                        helloHome = new Phrase()
                        contacts = ['AJ']
                        phoneNumbers = [9495379373]
@@ -35,9 +36,9 @@ public class LocationVar extends SmartThing {
                        hubs = [[id:0, localIP:"128.195.204.105"]]
 
                        if (init)
-                               mode.append("away")     
+                               mode = "away"   
                        else
-                               mode.append("home")
+                               mode = "home"
 
                        deviceValuesMap.put("mode", mode)
                        deviceValuesMap.put("name", "hub0")
index 37deb0a..48c2e0b 100644 (file)
@@ -25,7 +25,7 @@ public class Locks extends SmartThings {
 
        // Methods to set values
        def lock() {
-               lock[0].lock()
+               locks[0].lock()
        }
 
        def lock(LinkedHashMap metaData) {
@@ -33,7 +33,7 @@ public class Locks extends SmartThings {
        }
 
        def unlock() {
-               lock[0].unlock()
+               locks[0].unlock()
        }
 
 
index d619868..5fb4528 100644 (file)
@@ -13,7 +13,7 @@ public class MobilePresences extends SmartThings {
                String id = "mobileDeviceID0"
                String label = "mobileDevice"
                String displayName = "mobileDevice"
-               String deviceNetworkId
+               String deviceNetworkId = "id58323"
 
                mobilePresences.add(new MobilePresence(sendEvent, id, label, displayName, deviceNetworkId))
        }
index 425b3ca..9afc0f4 100644 (file)
@@ -26,7 +26,6 @@ public class MusicPlayer extends SmartThing {
                // Initialization
                this.id = id
                this.label = label
-               this.currentLevel = currentLevel
                possibleValues.add("on")
                possibleValues.add("off")
 
index 1f46551..7b3b26e 100644 (file)
@@ -122,7 +122,7 @@ public class SmartThing {
        }
 
        // Methods to return values
-       def getProperty(String currentProperty) {
+       def propertyMissing(String currentProperty) {
                String property = currentProperty
                if (property.contains("current")) // Check to see if we have currentXXX or xxx
                        property = property.substring(7,8).toLowerCase()+property.substring(8);
index 4ac188d..3e1d4e0 100644 (file)
@@ -1,7 +1,7 @@
 //Create a class for SmartThings
 package SmartThing
 
-class SmartThings {
+public class SmartThings {
        List smartThings = new ArrayList()
 
        // Methods for closures
@@ -39,7 +39,9 @@ class SmartThings {
        }
 
        // Methods to return states of the devices
-       def getProperty(String currentProperty) {
+       def propertyMissing(String currentProperty) {
+               if (smartThings[0] == null)
+                       return
                List tmpValues = new ArrayList()
                tmpValues.add(smartThings[0].getProperty(currentProperty))
                return tmpValues
index b2d5981..dae0d85 100644 (file)
@@ -13,7 +13,7 @@ class Thermostats extends SmartThings {
                String id = "thermostatID0"
                String label = "thermostat"
                String displayName = "thermostat"
-               String climateName "climateName"
+               String climateName "climateName"
                String thermostatOperatingState
                String thermostatFanMode
                String thermostatMode
index f07a963..0c3ac3f 100644 (file)
@@ -1,17 +1,17 @@
-##beacon-control.groovy
+beacon-control.groovy
 #enhanced-auto-lock-door.groovy
-good-night-house.groovy
-##initial-state-event-streamer.groovy
+#good-night-house.groovy
+#initial-state-event-streamer.groovy
 #lock-it-at-a-specific-time.groovy
 #lock-it-when-i-leave.groovy
 #make-it-so.groovy
-nfc-tag-toggle.groovy
-##single-button-controller.groovy
-##smart-auto-lock-unlock.groovy
+#nfc-tag-toggle.groovy
+#single-button-controller.groovy
+#smart-auto-lock-unlock.groovy
 #unlock-it-when-i-arrive.groovy
 #auto-lock-door.smartapp.groovy
-##buffered-event-sender.groovy
-##ecobeeAwayFromHome.groovy
+#buffered-event-sender.groovy
+#ecobeeAwayFromHome.groovy
 #FireCO2Alarm.groovy
 ##groveStreams.groovy
 ##influxdb-logger.groovy