Skip to content

Commit 42dd832

Browse files
authored
Pass on OZW return values
1 parent 0c07f3a commit 42dd832

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/openzwave-polling.cc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,16 @@ namespace OZW {
6969

7070
NodeInfo *node;
7171
std::list<OpenZWave::ValueID>::iterator vit;
72-
72+
bool = false;
7373
if ((node = get_node_info(nodeid))) {
7474
for (vit = node->values.begin(); vit != node->values.end(); ++vit) {
7575
if ((*vit).GetCommandClassId() == comclass) {
76-
OpenZWave::Manager::Get()->EnablePoll((*vit), intensity);
76+
b = OpenZWave::Manager::Get()->EnablePoll((*vit), intensity);
7777
break;
7878
}
7979
}
8080
}
81+
info.GetReturnValue().Set(Nan::New<Boolean>(b));
8182
}
8283

8384
// ===================================================================
@@ -90,15 +91,16 @@ namespace OZW {
9091
uint8 comclass = info[1]->ToNumber()->Value();
9192
NodeInfo *node;
9293
std::list<OpenZWave::ValueID>::iterator vit;
93-
94+
b = false;
9495
if ((node = get_node_info(nodeid))) {
9596
for (vit = node->values.begin(); vit != node->values.end(); ++vit) {
9697
if ((*vit).GetCommandClassId() == comclass) {
97-
OpenZWave::Manager::Get()->DisablePoll((*vit));
98+
b = OpenZWave::Manager::Get()->DisablePoll((*vit));
9899
break;
99100
}
100101
}
101102
}
103+
info.GetReturnValue().Set(Nan::New<Boolean>(b));
102104
}
103105

104106
// Determine the polling of a device's state.

0 commit comments

Comments
 (0)