mirror of
https://github.com/mtan93/SmartThingsPublic.git
synced 2026-03-29 22:04:19 +01:00
Merge pull request #330 from mckeed/prob-398
PROB-398 Fix Homeseer Multi Instance encap parse
This commit is contained in:
@@ -80,19 +80,12 @@ def parse(String description) {
|
|||||||
if (cmd) {
|
if (cmd) {
|
||||||
result = zwaveEvent(cmd)
|
result = zwaveEvent(cmd)
|
||||||
}
|
}
|
||||||
// log.debug "Parsed ${description.inspect()} to ${result.inspect()}"
|
log.debug "Parsed ${description.inspect()} to ${result.inspect()}"
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
def zwaveEvent(physicalgraph.zwave.commands.multiinstancev1.MultiInstanceCmdEncap cmd) {
|
def zwaveEvent(physicalgraph.zwave.commands.multiinstancev1.MultiInstanceCmdEncap cmd) {
|
||||||
def encapsulated = null
|
def encapsulated = cmd.encapsulatedCommand([0x31: 1, 0x84: 2, 0x60: 1, 0x85: 1, 0x70: 1])
|
||||||
if (cmd.respondsTo("encapsulatedCommand")) {
|
|
||||||
encapsulated = cmd.encapsulatedCommand()
|
|
||||||
} else {
|
|
||||||
def hex1 = { n -> String.format("%02X", n) }
|
|
||||||
def sorry = "command: ${hex1(cmd.commandClass)}${hex1(cmd.command)}, payload: " + cmd.parameter.collect{ hex1(it) }.join(" ")
|
|
||||||
encapsulated = zwave.parse(sorry, [0x31: 1, 0x84: 2, 0x60: 1, 0x85: 1, 0x70: 1])
|
|
||||||
}
|
|
||||||
return encapsulated ? zwaveEvent(encapsulated) : null
|
return encapsulated ? zwaveEvent(encapsulated) : null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user