A change in location class for sunset/sunrise event + Adding appList for dimmer's...
[smartthings-infrastructure.git] / Location / LocationVar.groovy
old mode 100644 (file)
new mode 100755 (executable)
index a114c1f..99f3429
@@ -47,10 +47,12 @@ class LocationVar {
 
        //By Model Checker
        def setValue(LinkedHashMap eventDataMap) {
-               def sentMode = eventDataMap['value']
-               println("The location is changed to $sentMode!")
-               this.mode = sentMode
-               sendEvent(eventDataMap)
+               if (this.mode != eventDataMap['value']) {
+                       def sentMode = eventDataMap['value']
+                       println("The location is changed to $sentMode!")
+                       this.mode = sentMode
+                       sendEvent(eventDataMap)
+               }
        }
 
        def currentValue(String deviceFeature) {