+ sendEvent(eventDataMap)
+ }
+ } else if (eventDataMap["name"] == "switch") {
+ if (eventDataMap["value"] != colorControls[0].currentSwitch) {
+ this.currentSwitch = eventDataMap["value"]
+ colorControls[0].setValue(eventDataMap["value"], "switch")
+ sendEvent(eventDataMap)
+ }
+ } else if (eventDataMap["name"] == "colorTemperature") {
+ if (eventDataMap["value"].toInteger() != colorControls[0].colorTemperature) {
+ this.colorTemperature = eventDataMap["value"].toInteger()
+ colorControls[0].setValue(eventDataMap["value"], "colorTemperature")
+ sendEvent(eventDataMap)
+ }
+ } else if (eventDataMap["name"] == "level") {
+ if (eventDataMap["value"].toInteger() != colorControls[0].level) {
+ this.currentLevel = eventDataMap["value"].toInteger()
+ this.level = eventDataMap["value"].toInteger()
+ colorControls[0].setValue(eventDataMap["value"], "level")