From 6009bc52ab168195c45ed789600339cf50088cb5 Mon Sep 17 00:00:00 2001 From: Vinay Rao Date: Tue, 23 Aug 2016 02:59:06 -0700 Subject: [PATCH] SSVD-2532 setting up the generic name at install --- .../zigbee-rgbw-bulb.src/zigbee-rgbw-bulb.groovy | 13 ++++++++----- .../zigbee-white-color-temperature-bulb.groovy | 3 +++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/devicetypes/smartthings/zigbee-rgbw-bulb.src/zigbee-rgbw-bulb.groovy b/devicetypes/smartthings/zigbee-rgbw-bulb.src/zigbee-rgbw-bulb.groovy index de4f4d8..0f4c419 100644 --- a/devicetypes/smartthings/zigbee-rgbw-bulb.src/zigbee-rgbw-bulb.groovy +++ b/devicetypes/smartthings/zigbee-rgbw-bulb.src/zigbee-rgbw-bulb.groovy @@ -81,12 +81,15 @@ private getATTRIBUTE_COLOR_TEMPERATURE() { 0x0007 } def parse(String description) { log.debug "description is $description" - def finalResult = zigbee.getEvent(description) - if (finalResult) { - log.debug finalResult - if (finalResult.name=="level" && finalResult.value==0) {} + def event = zigbee.getEvent(description) + if (event) { + log.debug event + if (event.name=="level" && event.value==0) {} else { - sendEvent(finalResult) + if (event.name=="colorTemperature") { + setGenericName(event.value) + } + sendEvent(event) } } else { diff --git a/devicetypes/smartthings/zigbee-white-color-temperature-bulb.src/zigbee-white-color-temperature-bulb.groovy b/devicetypes/smartthings/zigbee-white-color-temperature-bulb.src/zigbee-white-color-temperature-bulb.groovy index 539d8fd..e2cac3a 100644 --- a/devicetypes/smartthings/zigbee-white-color-temperature-bulb.src/zigbee-white-color-temperature-bulb.groovy +++ b/devicetypes/smartthings/zigbee-white-color-temperature-bulb.src/zigbee-white-color-temperature-bulb.groovy @@ -74,6 +74,9 @@ def parse(String description) { if (event) { if (event.name=="level" && event.value==0) {} else { + if (event.name=="colorTemperature") { + setGenericName(event.value) + } sendEvent(event) } }