Skip to content

Commit

Permalink
Pass on OZW return values
Browse files Browse the repository at this point in the history
  • Loading branch information
mikefranken authored May 12, 2017
1 parent 0c07f3a commit 42dd832
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/openzwave-polling.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,16 @@ namespace OZW {

NodeInfo *node;
std::list<OpenZWave::ValueID>::iterator vit;

bool = false;
if ((node = get_node_info(nodeid))) {
for (vit = node->values.begin(); vit != node->values.end(); ++vit) {
if ((*vit).GetCommandClassId() == comclass) {
OpenZWave::Manager::Get()->EnablePoll((*vit), intensity);
b = OpenZWave::Manager::Get()->EnablePoll((*vit), intensity);
break;
}
}
}
info.GetReturnValue().Set(Nan::New<Boolean>(b));
}

// ===================================================================
Expand All @@ -90,15 +91,16 @@ namespace OZW {
uint8 comclass = info[1]->ToNumber()->Value();
NodeInfo *node;
std::list<OpenZWave::ValueID>::iterator vit;

b = false;
if ((node = get_node_info(nodeid))) {
for (vit = node->values.begin(); vit != node->values.end(); ++vit) {
if ((*vit).GetCommandClassId() == comclass) {
OpenZWave::Manager::Get()->DisablePoll((*vit));
b = OpenZWave::Manager::Get()->DisablePoll((*vit));
break;
}
}
}
info.GetReturnValue().Set(Nan::New<Boolean>(b));
}

// Determine the polling of a device's state.
Expand Down

0 comments on commit 42dd832

Please sign in to comment.