From: Seyed Amir Hossein Aqajari Date: Wed, 29 Jan 2020 23:27:40 +0000 (-0800) Subject: Fixing bugs in infrastructure X-Git-Url: http://plrg.eecs.uci.edu/git/?p=smartthings-infrastructure.git;a=commitdiff_plain;h=b6faf6d7663cbbca0606424d04c9fc89317a8941 Fixing bugs in infrastructure --- diff --git a/ColorControl/ColorControls.groovy b/ColorControl/ColorControls.groovy index 68fd6f0..d17f9e4 100644 --- a/ColorControl/ColorControls.groovy +++ b/ColorControl/ColorControls.groovy @@ -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() diff --git a/Location/LocationVar.groovy b/Location/LocationVar.groovy index 6a8e6d3..403055d 100755 --- a/Location/LocationVar.groovy +++ b/Location/LocationVar.groovy @@ -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") diff --git a/Lock/Locks.groovy b/Lock/Locks.groovy index 37deb0a..48c2e0b 100644 --- a/Lock/Locks.groovy +++ b/Lock/Locks.groovy @@ -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() } diff --git a/MobilePresence/MobilePresences.groovy b/MobilePresence/MobilePresences.groovy index d619868..5fb4528 100644 --- a/MobilePresence/MobilePresences.groovy +++ b/MobilePresence/MobilePresences.groovy @@ -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)) } diff --git a/MusicPlayer/MusicPlayer.groovy b/MusicPlayer/MusicPlayer.groovy index 425b3ca..9afc0f4 100644 --- a/MusicPlayer/MusicPlayer.groovy +++ b/MusicPlayer/MusicPlayer.groovy @@ -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") diff --git a/SmartThing/SmartThing.groovy b/SmartThing/SmartThing.groovy index 1f46551..7b3b26e 100644 --- a/SmartThing/SmartThing.groovy +++ b/SmartThing/SmartThing.groovy @@ -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); diff --git a/SmartThing/SmartThings.groovy b/SmartThing/SmartThings.groovy index 4ac188d..3e1d4e0 100644 --- a/SmartThing/SmartThings.groovy +++ b/SmartThing/SmartThings.groovy @@ -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 diff --git a/Thermostat/Thermostats.groovy b/Thermostat/Thermostats.groovy index b2d5981..dae0d85 100644 --- a/Thermostat/Thermostats.groovy +++ b/Thermostat/Thermostats.groovy @@ -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 diff --git a/appLists/device-interaction/locksAppList b/appLists/device-interaction/locksAppList index f07a963..0c3ac3f 100644 --- a/appLists/device-interaction/locksAppList +++ b/appLists/device-interaction/locksAppList @@ -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