From d8c89f6c6a785da874841c1f641c1e040943c280 Mon Sep 17 00:00:00 2001 From: Vinay Rao Date: Thu, 2 Feb 2017 18:10:34 -0800 Subject: [PATCH 1/2] DVCSMP-2391 Iris 4 button device mapping to button 1 only --- .../zigbee-button.src/zigbee-button.groovy | 32 +++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/devicetypes/smartthings/zigbee-button.src/zigbee-button.groovy b/devicetypes/smartthings/zigbee-button.src/zigbee-button.groovy index 311c659..97948d1 100644 --- a/devicetypes/smartthings/zigbee-button.src/zigbee-button.groovy +++ b/devicetypes/smartthings/zigbee-button.src/zigbee-button.groovy @@ -118,8 +118,7 @@ private Map getBatteryResult(rawValue) { private Map parseNonIasButtonMessage(Map descMap){ def buttonState = "" def buttonNumber = 0 - if (((device.getDataValue("model") == "3460-L") || (device.getDataValue("model") == "3450-L")) - &&(descMap.clusterInt == 0x0006)) { + if ((device.getDataValue("model") == "3460-L") &&(descMap.clusterInt == 0x0006)) { if (descMap.command == "01") { getButtonResult("press") } @@ -127,6 +126,35 @@ private Map parseNonIasButtonMessage(Map descMap){ getButtonResult("release") } } + else if ((device.getDataValue("model") == "3450-L") && (descMap.clusterInt == 0x0006)) { + log.info "For 3450-L" + log.trace "descMap : $descMap" + if (descMap.command == "01") { + getButtonResult("press") + } + else if (descMap.command == "00") { + def button = 1 + switch(descMap.sourceEndpoint) { + case "01": + button = 4 + break + case "02": + button = 3 + break + case "03": + button = 1 + break + case "04": + button = 2 + break + default: + button = 1 + break + } + + getButtonResult("release", button) + } + } else if (descMap.clusterInt == 0x0006) { buttonState = "pushed" if (descMap.command == "01") { From 8e6d009d676c9c2dc10e59fd56df6a977d5b6da6 Mon Sep 17 00:00:00 2001 From: Vinay Rao Date: Thu, 2 Feb 2017 18:52:23 -0800 Subject: [PATCH 2/2] changes suggested by Tom and Zach --- .../zigbee-button.src/zigbee-button.groovy | 25 ++++++++----------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/devicetypes/smartthings/zigbee-button.src/zigbee-button.groovy b/devicetypes/smartthings/zigbee-button.src/zigbee-button.groovy index 97948d1..47dd320 100644 --- a/devicetypes/smartthings/zigbee-button.src/zigbee-button.groovy +++ b/devicetypes/smartthings/zigbee-button.src/zigbee-button.groovy @@ -119,36 +119,31 @@ private Map parseNonIasButtonMessage(Map descMap){ def buttonState = "" def buttonNumber = 0 if ((device.getDataValue("model") == "3460-L") &&(descMap.clusterInt == 0x0006)) { - if (descMap.command == "01") { + if (descMap.commandInt == 1) { getButtonResult("press") } - else if (descMap.command == "00") { + else if (descMap.commandInt == 0) { getButtonResult("release") } } else if ((device.getDataValue("model") == "3450-L") && (descMap.clusterInt == 0x0006)) { - log.info "For 3450-L" - log.trace "descMap : $descMap" - if (descMap.command == "01") { + if (descMap.commandInt == 1) { getButtonResult("press") } - else if (descMap.command == "00") { - def button = 1 + else if (descMap.commandInt == 0) { + def button = 1 switch(descMap.sourceEndpoint) { - case "01": - button = 4 + case "01": + button = 4 break case "02": - button = 3 + button = 3 break case "03": - button = 1 + button = 1 break case "04": - button = 2 - break - default: - button = 1 + button = 2 break }