Methods
getNode(device, callbackopt) → {Promise}
Get a ZwaveNode instance for a Device
Parameters:
Name | Type | Attributes | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
device |
Device
|
An instance of Device |
||||||||||
callback |
function
|
<optional> |
|
Returns:
- Type:
-
Promise
Example
const Homey = require('homey');
class MyZwaveDevice extends Homey.Device {
onInit() {
Homey.ManagerZwave.getNode( this )
.then( node => {
node.CommandClass['COMMAND_CLASS_BASIC'].on('report', ( command, report ) => {
this.log('onReport', command, report);
})
node.CommandClass['COMMAND_CLASS_BASIC'].BASIC_SET({
'Value': 0xFF
})
.then( this.log )
.catch( this.error )
})
.catch( this.error );
}
}