From ce01ec1fc4cb9d073c76bdc6505f4c1121e6d5b1 Mon Sep 17 00:00:00 2001 From: "k.klimczuk2" Date: Fri, 27 Sep 2019 18:22:38 +0200 Subject: [PATCH 1/2] ICP-11103 - sending a supportedWindowShadeCommands event --- .../zigbee-window-shade.src/zigbee-window-shade.groovy | 1 + 1 file changed, 1 insertion(+) diff --git a/devicetypes/smartthings/zigbee-window-shade.src/zigbee-window-shade.groovy b/devicetypes/smartthings/zigbee-window-shade.src/zigbee-window-shade.groovy index b3331d7945b..9d989ef1e2a 100755 --- a/devicetypes/smartthings/zigbee-window-shade.src/zigbee-window-shade.groovy +++ b/devicetypes/smartthings/zigbee-window-shade.src/zigbee-window-shade.groovy @@ -205,6 +205,7 @@ def configure() { // Device-Watch allows 2 check-in misses from device + ping (plus 2 min lag time) log.info "configure()" sendEvent(name: "checkInterval", value: 2 * 60 * 60 + 2 * 60, displayed: false, data: [protocol: "zigbee", hubHardwareId: device.hub.hardwareID]) + sendEvent(name: "supportedWindowShadeCommands", value: JsonOutput.toJson(["open", "close", "pause"])) log.debug "Configuring Reporting and Bindings." def cmds From 660a55def1bf024221ce08913ca5f2da96569755 Mon Sep 17 00:00:00 2001 From: "k.klimczuk2" Date: Mon, 30 Sep 2019 09:47:56 +0200 Subject: [PATCH 2/2] ICP-11103 - sending supportedWindowShadeCommands event in installed(), updating existing devices in parse() --- .../zigbee-window-shade.groovy | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/devicetypes/smartthings/zigbee-window-shade.src/zigbee-window-shade.groovy b/devicetypes/smartthings/zigbee-window-shade.src/zigbee-window-shade.groovy index 9d989ef1e2a..67a1f92fd3a 100755 --- a/devicetypes/smartthings/zigbee-window-shade.src/zigbee-window-shade.groovy +++ b/devicetypes/smartthings/zigbee-window-shade.src/zigbee-window-shade.groovy @@ -11,6 +11,7 @@ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License * for the specific language governing permissions and limitations under the License. */ +import groovy.json.JsonOutput import physicalgraph.zigbee.zcl.DataType metadata { @@ -82,9 +83,20 @@ private List collectAttributes(Map descMap) { return descMaps } +def installed() { + log.debug "installed" + sendEvent(name: "supportedWindowShadeCommands", value: JsonOutput.toJson(["open", "close", "pause"])) +} + // Parse incoming device messages to generate events def parse(String description) { log.debug "description:- ${description}" + + // update existing devices + if (!state.supportedWindowShadeCommands) { + sendEvent(name: "supportedWindowShadeCommands", value: JsonOutput.toJson(["open", "close", "pause"])) + } + if (description?.startsWith("read attr -")) { Map descMap = zigbee.parseDescriptionAsMap(description) if (isBindingTableMessage(description)) { @@ -205,7 +217,6 @@ def configure() { // Device-Watch allows 2 check-in misses from device + ping (plus 2 min lag time) log.info "configure()" sendEvent(name: "checkInterval", value: 2 * 60 * 60 + 2 * 60, displayed: false, data: [protocol: "zigbee", hubHardwareId: device.hub.hardwareID]) - sendEvent(name: "supportedWindowShadeCommands", value: JsonOutput.toJson(["open", "close", "pause"])) log.debug "Configuring Reporting and Bindings." def cmds