Skip to content

Commit

Permalink
Merge pull request SmartThingsCommunity#46642 from SmartThingsCommuni…
Browse files Browse the repository at this point in the history
…ty/acceptance

Rolling up acceptance to production for deploy
  • Loading branch information
greens authored Oct 6, 2020
2 parents 8f4a439 + 3983ad9 commit 95c3507
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,25 +107,19 @@ def parse(String description) {
Map eventMap = zigbee.getEvent(description)
Map eventDescMap = zigbee.parseDescriptionAsMap(description)

if (!eventMap && eventDescMap) {
eventMap = [:]
if (eventDescMap?.clusterId == zigbee.ONOFF_CLUSTER) {
eventMap[name] = "switch"
eventMap[value] = eventDescMap?.value
}
}

if (eventMap) {
if (eventDescMap?.sourceEndpoint == "01" || eventDescMap?.endpoint == "01") {
sendEvent(eventMap)
} else {
def childDevice = childDevices.find {
it.deviceNetworkId == "$device.deviceNetworkId:${eventDescMap.sourceEndpoint}" || it.deviceNetworkId == "$device.deviceNetworkId:${eventDescMap.endpoint}"
}
if (childDevice) {
childDevice.sendEvent(eventMap)
if (eventDescMap && eventDescMap?.attrId == "0000") {//0x0000 : OnOff attributeId
if (eventDescMap?.sourceEndpoint == "01" || eventDescMap?.endpoint == "01") {
sendEvent(eventMap)
} else {
log.debug "Child device: $device.deviceNetworkId:${eventDescMap.sourceEndpoint} was not found"
def childDevice = childDevices.find {
it.deviceNetworkId == "$device.deviceNetworkId:${eventDescMap.sourceEndpoint}" || it.deviceNetworkId == "$device.deviceNetworkId:${eventDescMap.endpoint}"
}
if (childDevice) {
childDevice.sendEvent(eventMap)
} else {
log.debug "Child device: $device.deviceNetworkId:${eventDescMap.sourceEndpoint} was not found"
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ metadata {
fingerprint profileId: "C05E", inClusters: "0000, 0003, 0004, 0005, 0006, FFFF", outClusters: "0019", manufacturer: "MEGAMAN", model: "BSZTM005", deviceJoinName: "INGENIUM Switch" //INGENIUM ZB Mains Switching Module

// Innr
fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006, 0008, 0B05, 1000, FC82", outClusters: "000A, 0019", manufacturer: "innr", model: "SP 220", deviceJoinName: "Innr Outlet", ocfDeviceType: "oic.d.smartplug" //Innr Smart Plug
fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006, 0008, 0B05, 1000, FC82", outClusters: "000A, 0019", manufacturer: "innr", model: "SP 222", deviceJoinName: "Innr Outlet", ocfDeviceType: "oic.d.smartplug" //Innr Smart Plug
fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006, 0008, 0B05, 1000, FC82", outClusters: "000A, 0019", manufacturer: "innr", model: "SP 224", deviceJoinName: "Innr Outlet", ocfDeviceType: "oic.d.smartplug" //Innr Smart Plug

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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<Map> collectAttributes(Map descMap) {
List<Map> descMaps = new ArrayList<Map>()
Expand Down Expand Up @@ -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)
}
}
}
Expand Down Expand Up @@ -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"
}
Expand Down Expand Up @@ -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) {
Expand All @@ -279,19 +259,7 @@ private List readDeviceBindingTable() {
}

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"
return isSomfy()
}

def isSomfy() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ metadata {
fingerprint mfr: "0090", prod: "0003", model: "0446", deviceJoinName: "Kwikset Door Lock" //99140 //Kwikset Convert Deadbolt Door Lock
fingerprint mfr: "033F", prod: "0001", model: "0001", deviceJoinName: "August Door Lock" //August Smart Lock Pro
fingerprint mfr: "021D", prod: "0003", model: "0001", deviceJoinName: "Alfred Door Lock" // DB2 //Alfred Smart Home Touchscreen Deadbolt
//zw:Fs type:4001 mfr:0154 prod:0005 model:0001 ver:1.05 zwv:4.38 lib:03 cc:7A,73,80,5A,98 sec:5E,86,72,30,71,70,59,85,62
fingerprint mfr: "0154", prod: "0005", model: "0001", deviceJoinName: "POPP Door Lock" // POPP Strike Lock Control POPE012501
}

simulator {
Expand Down

0 comments on commit 95c3507

Please sign in to comment.