Skip to content

Commit

Permalink
fixing errors due to missing if case parsing OTA data
Browse files Browse the repository at this point in the history
  • Loading branch information
Vinay Rao authored and Vinay Rao committed Aug 5, 2015
1 parent d5b0181 commit 140431d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
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 140431d

Please sign in to comment.