private String displayName = "switchLevel0"
private int level = 50
private int rate = 50
- private String switchState = "off"
- private String currentSwitch = "off"
- private String switchLatestValue = "off"
+ private String switchState = "on"
+ private String currentSwitch = "on"
+ private String switchLatestValue = "on"
SwitchLevels(Closure sendEvent, int deviceNumbers) {
this.sendEvent = sendEvent
this.rate = level
}
}
+
+ def setLevel(long level) {
+ if (this.level != level) {
+ switchLevels[0].setLevel(level)
+ this.level = level
+ this.rate = level
+ }
+ }
def on() {
switchLatestValue = "on"