OpenZWave / node-openzwave-shared

OpenZWave addon for Node.js (all versions) including management and security functions
Other
199 stars 113 forks source link

AddNode() get added node informations #298

Closed pascal-mormin closed 5 years ago

pascal-mormin commented 5 years ago

Hi, My question in focused on the way to add a node, i know there is some issues treating about this subject but i can't find exactly what i want.

I have to do something like @jodyalbritton said in #224

// POST to add a node
router.route('/commands/add')
  .post(function (req, res, next) {
    nodeServer.zwave.addNode()
    console.log('adding')
    res.send(200)
  })
// POST to remove a node
router.route('/commands/remove')
  .post(function (req, res, next) {
    nodeServer.zwave.removeNode()
    console.log('removing')
    res.send(200)
  })

but i want to know if there is a way, when i execute zwave.addNode(), to get just added node informations ?

robertsLando commented 5 years ago

Add node starts the inclusion mode in the controller, if the node is discovered you will get the feedback on nodeAdded event callback and node info in nodeReady event callback and

pascal-mormin commented 5 years ago

@robertsLando Thank you for your reply. I now understand how this works.