From 4bece7c4896a1bb6c4596d3f7f7bfc01fc8666f0 Mon Sep 17 00:00:00 2001 From: Konrad Klimczuk Date: Mon, 28 Sep 2020 07:56:32 +0200 Subject: [PATCH 1/2] ICP-13694 - removes supporting the Battery capability --- .../zigbee-window-shade.groovy | 36 ------------------- 1 file changed, 36 deletions(-) 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 ea37642a2e6..7f0ee30e8b9 100755 --- a/devicetypes/smartthings/zigbee-window-shade.src/zigbee-window-shade.groovy +++ b/devicetypes/smartthings/zigbee-window-shade.src/zigbee-window-shade.groovy @@ -18,7 +18,6 @@ import physicalgraph.zigbee.zcl.DataType metadata { definition(name: "ZigBee Window Shade", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.blind", mnmn: "SmartThings", vid: "generic-shade") { capability "Actuator" - capability "Battery" capability "Configuration" capability "Refresh" capability "Window Shade" @@ -80,7 +79,6 @@ private getCOMMAND_GOTO_LIFT_PERCENTAGE() { 0x05 } private getATTRIBUTE_POSITION_LIFT() { 0x0008 } private getATTRIBUTE_CURRENT_LEVEL() { 0x0000 } private getCOMMAND_MOVE_LEVEL_ONOFF() { 0x04 } -private getBATTERY_PERCENTAGE_REMAINING() { 0x0021 } private List collectAttributes(Map descMap) { List descMaps = new ArrayList() @@ -117,9 +115,6 @@ def parse(String description) { def valueInt = Math.round((zigbee.convertHexToInt(descMap.value)) / 255 * 100) levelEventHandler(valueInt) - } else if (reportsBatteryPercentage() && descMap?.clusterInt == zigbee.POWER_CONFIGURATION_CLUSTER && zigbee.convertHexToInt(descMap?.attrId) == BATTERY_PERCENTAGE_REMAINING && descMap.value) { - def batteryLevel = zigbee.convertHexToInt(descMap.value) - batteryPercentageEventHandler(batteryLevel) } } } @@ -152,13 +147,6 @@ def updateFinalState() { } } -def batteryPercentageEventHandler(batteryLevel) { - if (batteryLevel != null) { - batteryLevel = Math.min(100, Math.max(0, batteryLevel)) - sendEvent([name: "battery", value: batteryLevel, unit: "%", descriptionText: "{{ device.displayName }} battery was {{ value }}%"]) - } -} - def supportsLiftPercentage() { device.getDataValue("manufacturer") != "Feibit Co.Ltd" } @@ -243,17 +231,9 @@ def configure() { cmds += readDeviceBindingTable() } - if (reportsBatteryPercentage()) { - cmds += zigbee.configureReporting(zigbee.POWER_CONFIGURATION_CLUSTER, BATTERY_PERCENTAGE_REMAINING, DataType.UINT8, 30, 21600, 0x01) - } - return refresh() + cmds } -def usesLocalGroupBinding() { - isIkeaKadrilj() || isIkeaFyrtur() -} - private def parseBindingTableMessage(description) { Integer groupAddr = getGroupAddrFromBindingTable(description) if (groupAddr) { @@ -278,22 +258,6 @@ private List readDeviceBindingTable() { ["zdo mgmt-bind 0x${device.deviceNetworkId} 0", "delay 200"] } -def shouldInvertLiftPercentage() { - return isIkeaKadrilj() || isIkeaFyrtur() || isSomfy() -} - -def reportsBatteryPercentage() { - return isIkeaKadrilj() || isIkeaFyrtur() -} - -def isIkeaKadrilj() { - device.getDataValue("model") == "KADRILJ roller blind" -} - -def isIkeaFyrtur() { - device.getDataValue("model") == "FYRTUR block-out roller blind" -} - def isSomfy() { device.getDataValue("manufacturer") == "SOMFY" } \ No newline at end of file From bb2a838d3240cdadb315873fd5ac344457902c01 Mon Sep 17 00:00:00 2001 From: Konrad Klimczuk Date: Tue, 29 Sep 2020 07:31:55 +0200 Subject: [PATCH 2/2] ICP-13694 - removes supporting the Battery capability --- .../zigbee-window-shade.src/zigbee-window-shade.groovy | 4 ++++ 1 file changed, 4 insertions(+) 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 7f0ee30e8b9..705c2520288 100755 --- a/devicetypes/smartthings/zigbee-window-shade.src/zigbee-window-shade.groovy +++ b/devicetypes/smartthings/zigbee-window-shade.src/zigbee-window-shade.groovy @@ -258,6 +258,10 @@ private List readDeviceBindingTable() { ["zdo mgmt-bind 0x${device.deviceNetworkId} 0", "delay 200"] } +def shouldInvertLiftPercentage() { + return isSomfy() +} + def isSomfy() { device.getDataValue("manufacturer") == "SOMFY" } \ No newline at end of file