From be2e19e4069cd65bfc5317befe943bb4b96a8ff9 Mon Sep 17 00:00:00 2001 From: Zach Varberg Date: Thu, 26 Jan 2017 10:24:26 -0600 Subject: [PATCH] Manually refresh on/off status after setLevel This is because ZLL bulbs do not report or allow for configuration of reporting of attributes. As a result if we change a value, we have to manually call a read of that attribute to update our status. This is a part of: https://smartthings.atlassian.net/browse/DPROT-227 --- devicetypes/smartthings/cree-bulb.src/cree-bulb.groovy | 2 +- .../smartthings/zll-dimmer-bulb.src/zll-dimmer-bulb.groovy | 2 +- devicetypes/smartthings/zll-rgb-bulb.src/zll-rgb-bulb.groovy | 2 +- devicetypes/smartthings/zll-rgbw-bulb.src/zll-rgbw-bulb.groovy | 2 +- .../zll-white-color-temperature-bulb.groovy | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/devicetypes/smartthings/cree-bulb.src/cree-bulb.groovy b/devicetypes/smartthings/cree-bulb.src/cree-bulb.groovy index 26fa1b995df..58a81842def 100644 --- a/devicetypes/smartthings/cree-bulb.src/cree-bulb.groovy +++ b/devicetypes/smartthings/cree-bulb.src/cree-bulb.groovy @@ -82,7 +82,7 @@ def on() { } def setLevel(value) { - zigbee.setLevel(value) + ["delay 500"] + zigbee.levelRefresh() //adding refresh because of ZLL bulb not conforming to send-me-a-report + zigbee.setLevel(value) + zigbee.onOffRefresh() + zigbee.levelRefresh() //adding refresh because of ZLL bulb not conforming to send-me-a-report } /** diff --git a/devicetypes/smartthings/zll-dimmer-bulb.src/zll-dimmer-bulb.groovy b/devicetypes/smartthings/zll-dimmer-bulb.src/zll-dimmer-bulb.groovy index cce0862a8c0..a0568e730ec 100644 --- a/devicetypes/smartthings/zll-dimmer-bulb.src/zll-dimmer-bulb.groovy +++ b/devicetypes/smartthings/zll-dimmer-bulb.src/zll-dimmer-bulb.groovy @@ -89,7 +89,7 @@ def on() { } def setLevel(value) { - zigbee.setLevel(value) + ["delay 1500"] + zigbee.levelRefresh() //adding refresh because of ZLL bulb not conforming to send-me-a-report + zigbee.setLevel(value) + zigbee.onOffRefresh() + zigbee.levelRefresh() //adding refresh because of ZLL bulb not conforming to send-me-a-report } def refresh() { diff --git a/devicetypes/smartthings/zll-rgb-bulb.src/zll-rgb-bulb.groovy b/devicetypes/smartthings/zll-rgb-bulb.src/zll-rgb-bulb.groovy index 59883343ac5..ad591e1d0ec 100644 --- a/devicetypes/smartthings/zll-rgb-bulb.src/zll-rgb-bulb.groovy +++ b/devicetypes/smartthings/zll-rgb-bulb.src/zll-rgb-bulb.groovy @@ -115,7 +115,7 @@ def refreshAttributes() { } def setLevel(value) { - zigbee.setLevel(value) + ["delay 1500"] + zigbee.levelRefresh() //adding refresh because of ZLL bulb not conforming to send-me-a-report + zigbee.setLevel(value) + zigbee.onOffRefresh() + zigbee.levelRefresh() //adding refresh because of ZLL bulb not conforming to send-me-a-report } def setColor(value){ diff --git a/devicetypes/smartthings/zll-rgbw-bulb.src/zll-rgbw-bulb.groovy b/devicetypes/smartthings/zll-rgbw-bulb.src/zll-rgbw-bulb.groovy index 5d9e7005c08..ce1ac657a6a 100644 --- a/devicetypes/smartthings/zll-rgbw-bulb.src/zll-rgbw-bulb.groovy +++ b/devicetypes/smartthings/zll-rgbw-bulb.src/zll-rgbw-bulb.groovy @@ -135,7 +135,7 @@ def setColorTemperature(value) { } def setLevel(value) { - zigbee.setLevel(value) + ["delay 1500"] + zigbee.levelRefresh() //adding refresh because of ZLL bulb not conforming to send-me-a-report + zigbee.setLevel(value) + zigbee.onOffRefresh() + zigbee.levelRefresh() //adding refresh because of ZLL bulb not conforming to send-me-a-report } def setColor(value){ diff --git a/devicetypes/smartthings/zll-white-color-temperature-bulb.src/zll-white-color-temperature-bulb.groovy b/devicetypes/smartthings/zll-white-color-temperature-bulb.src/zll-white-color-temperature-bulb.groovy index 98ddddd3291..737a9336c76 100644 --- a/devicetypes/smartthings/zll-white-color-temperature-bulb.src/zll-white-color-temperature-bulb.groovy +++ b/devicetypes/smartthings/zll-white-color-temperature-bulb.src/zll-white-color-temperature-bulb.groovy @@ -90,7 +90,7 @@ def on() { } def setLevel(value) { - zigbee.setLevel(value) + ["delay 1500"] + zigbee.levelRefresh() + zigbee.setLevel(value) + zigbee.onOffRefresh() + zigbee.levelRefresh() } def refresh() {