Fixing a bug: there is no property level, so it should have called currentLevel instead.
[smartthings-infrastructure.git] / SwitchLevel / SwitchLevels.groovy
index aa931d95ba734d5039e0c41dc96ccdbd94824dbf..71c5a85446d00a89b7f8b4eb0f7459bedc9331ae 100644 (file)
@@ -141,7 +141,7 @@ public class SwitchLevels {
                                sendEvent(eventDataMap)
                        }
                } else if (eventDataMap["name"] == "level") {
-                       if (eventDataMap["value"].toInteger() != switchLevels[0].level) {
+                       if (eventDataMap["value"].toInteger() != switchLevels[0].currentLevel) {
                                this.currentLevel = eventDataMap["value"].toInteger()
                                this.rate = eventDataMap["value"].toInteger()
                                switchLevels[0].setValue(eventDataMap["value"], "level")