mirror of
https://github.com/mtan93/SmartThingsPublic.git
synced 2026-03-08 21:02:56 +00:00
Merge pull request #11 from workingmonk/smartpower_outlet_errors
[DVCSMP-790] fixing errors due to missing if case parsing OTA data
This commit is contained in:
@@ -60,8 +60,8 @@ def parse(String description) {
|
|||||||
if (descMap.cluster == "0006" && descMap.attrId == "0000") {
|
if (descMap.cluster == "0006" && descMap.attrId == "0000") {
|
||||||
name = "switch"
|
name = "switch"
|
||||||
value = descMap.value.endsWith("01") ? "on" : "off"
|
value = descMap.value.endsWith("01") ? "on" : "off"
|
||||||
} else {
|
} else if (descMap.cluster.equalsIgnoreCase("0B04") && descMap.attrId.equalsIgnoreCase("050b")) {
|
||||||
def reportValue = description.split(",").find {it.split(":")[0].trim() == "value"}?.split(":")[1].trim()
|
def reportValue = descMap.value
|
||||||
name = "power"
|
name = "power"
|
||||||
// assume 16 bit signed for encoding and power divisor is 10
|
// assume 16 bit signed for encoding and power divisor is 10
|
||||||
value = Integer.parseInt(reportValue, 16) / 10
|
value = Integer.parseInt(reportValue, 16) / 10
|
||||||
|
|||||||
Reference in New Issue
Block a user