hortinstein / node-dash-button

A small module to emit events when an Amazon Dash Button is pressed
949 stars 94 forks source link

Merging continuous arp requests #16

Closed gerardo-navarro closed 8 years ago

gerardo-navarro commented 8 years ago

Hi Guys,

first of all. Thank you very much for this awesome package. You make it easy to play around with the dash button. Nice job.

However, once I press the dash button, my app registers to two continuous request. I know that you mention this in the documentation. But, I was wondering if there is a way to merge the two requests which originate from one button press?

Thanks for the help.

Gerardo

hortinstein commented 8 years ago

try adjusting the timeout code on line 73 of index.js if your network is still registering multiple presses after 3 seconds: setTimeout(function () { just_emitted = false; }, 3000);. If that doesn't work you can handle it in your code by adjusting a just pressed flag

ecaron commented 8 years ago

I was experiencing this, too. I think my PR (#18) fixes this.

hortinstein commented 8 years ago

Thank you, the pull request is merged! Please let me know if anyone else continues to have this issue