Difference between revisions of "Zwave Object"
Mike.maxwell (talk | contribs) (→getCommand) |
Mike.maxwell (talk | contribs) (→getCommand) |
||
Line 20: | Line 20: | ||
'''Example''' | '''Example''' | ||
− | + | def zwaveEvent(hubitat.zwave.commands.crc16encapv1.Crc16Encap cmd) { | |
− | + | def encapsulatedCommand = zwave.getCommand(cmd.commandClass, cmd.command, cmd.data,1) | |
− | + | if (encapsulatedCommand) { | |
+ | zwaveEvent(encapsulatedCommand) | ||
+ | } else { | ||
+ | log.warn "Unable to extract CRC16 command from ${cmd}" | ||
+ | } | ||
+ | } |
Revision as of 17:37, 11 January 2019
Description
Description goes here
Methods
getCommand
Returns a zwave object given the commandClass, command and an optional version.
Signature
Command getCommand(Short commandClass, Short command, List<Short> payload, Integer version = null)
Parameters
commandClass - TODO TODO
Returns
Command - TODO
Example def zwaveEvent(hubitat.zwave.commands.crc16encapv1.Crc16Encap cmd) {
def encapsulatedCommand = zwave.getCommand(cmd.commandClass, cmd.command, cmd.data,1) if (encapsulatedCommand) { zwaveEvent(encapsulatedCommand) } else { log.warn "Unable to extract CRC16 command from ${cmd}" }
}