Skip to content

Commit

Permalink
Merge pull request #202 from rumata28/bug/enable-poll-bug-fix
Browse files Browse the repository at this point in the history
Fix in EnablePoll method, it instead of getting a value from index 1,…
  • Loading branch information
ekarak authored Nov 11, 2017
2 parents 47b2281 + cdeaf5d commit 5f07076
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/openzwave-polling.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ namespace OZW {
OpenZWave::ValueID* vit = populateValueId(info);
bool b = false;
if (vit) {
uint8 intensity = (info.Length() > 4) ? Nan::To<Number>(info[4]).ToLocalChecked()->Value() : 1;
uint8 idxpos = (info[0]->IsObject()) ? 1 : 4;
uint8 intensity = Nan::To<Number>(info[idxpos]).ToLocalChecked()->Value();

b = OpenZWave::Manager::Get()->EnablePoll((*vit), intensity);
}
info.GetReturnValue().Set(Nan::New<Boolean>(b));
Expand Down

0 comments on commit 5f07076

Please sign in to comment.