Difference between revisions of "Zwave Object"

From Hubitat Documentation
Jump to: navigation, search
(getCommand)
(getCommand)
Line 20: Line 20:
  
 
'''Example'''
 
'''Example'''
//TODO
+
def zwaveEvent(hubitat.zwave.commands.crc16encapv1.Crc16Encap cmd) {
int i = 5
+
    def encapsulatedCommand = zwave.getCommand(cmd.commandClass, cmd.command, cmd.data,1)
def hexStr = hubitat.helper.HexUtils.integerToHexString(i, 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}"
   }

}