Skip to content

Commit

Permalink
Merge pull request SmartThingsCommunity#11 from workingmonk/smartpowe…
Browse files Browse the repository at this point in the history
…r_outlet_errors

[DVCSMP-790] fixing errors due to missing if case parsing OTA data
  • Loading branch information
workingmonk committed Aug 5, 2015
2 parents d5b0181 + 140431d commit 0a9a86e
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -60,8 +60,8 @@ def parse(String description) {
if (descMap.cluster == "0006" && descMap.attrId == "0000") {
name = "switch"
value = descMap.value.endsWith("01") ? "on" : "off"
} else {
def reportValue = description.split(",").find {it.split(":")[0].trim() == "value"}?.split(":")[1].trim()
} else if (descMap.cluster.equalsIgnoreCase("0B04") && descMap.attrId.equalsIgnoreCase("050b")) {
def reportValue = descMap.value
name = "power"
// assume 16 bit signed for encoding and power divisor is 10
value = Integer.parseInt(reportValue, 16) / 10
Expand Down

0 comments on commit 0a9a86e

Please sign in to comment.