Add changes in events
[smartthings-infrastructure.git] / SmartThing / SmartThing.groovy
index 7f08910f9e940639cc6070a229dd20adeb0e8964..a6907601d2edb3d0612daeaee6d012f45a6eac95 100644 (file)
@@ -9,6 +9,7 @@ import MutableInteger.MutableInteger
 
 public class SmartThing {      
        List nonStoredDevices = ["aeonKeyFob", "appTouch", "button", "momentary", "nfcTouch"] // Devices with no stored value
+       List locationTimeFeatures = ["sunset", "sunrise", "sunriseTime", "sunsetTime"]
        def sendEventSmartThings
 
        StringBuilder idSmartThing = new StringBuilder()
@@ -41,6 +42,10 @@ public class SmartThing {
                } else if (nonStoredDevices.contains(name)) {
                        println("the $name with id:$tmpID is triggered to $value!")
                        sendEventSmartThings(eventDataMap)
+               } else if (locationTimeFeatures.contains(name)) {
+                       return System.currentTimeMillis()
+                       println("This is $name!")
+                       sendEventSmartThings(eventDataMap)
                }
        }