changes in switch level class
[smartthings-infrastructure.git] / SwitchLevel / SwitchLevel.groovy
index 2b5020eab7b4334234e02e550919768618d25b60..ac7895733f874a70fe2af93a47784c10d2e39c68 100644 (file)
@@ -15,6 +15,7 @@ public class SwitchLevel {
        private int hue
        private int currentHue
        private int saturation
+       private int currentSaturation
        private String switchLatestValue
        def sendEvent   
        def timers
@@ -33,6 +34,7 @@ public class SwitchLevel {
                this.hue = hue
                this.currentHue = hue
                this.saturation = saturation
+               this.currentSaturation = saturation
                this.switchState = switchState
                this.currentSwitch = switchState
                this.switchLatestValue = switchLatestValue
@@ -48,6 +50,7 @@ public class SwitchLevel {
                        this.hue = metaData["hue"]
                        this.currentHue = metaData["hue"]
                        this.saturation = metaData["saturation"]
+                       this.currentSaturation = metaData["saturation"]
                        println("the switch with id:$id is setted to level $level and hue to $hue and saturation to $saturation!")
                        sendEvent([name: "level", value: "$level", deviceId: this.id, descriptionText: "",
                                   displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])