rwaldron / johnny-five

JavaScript Robotics and IoT programming framework, developed at Bocoup.
http://johnny-five.io
Other
13.26k stars 1.76k forks source link

Button debounce is hardcoded to 7ms #1809

Open ChristophLabacher opened 1 year ago

ChristophLabacher commented 1 year ago

According to the docs, a button can be initialized with a debounce parameter. However, in the code for the Button class, this value is never read and the debounce time is hardcoded to 7ms: https://github.com/rwaldron/johnny-five/blob/main/lib/button.js#L190

Am I right in assuming the parameter should be used here? If yes, I’m happy to submit a PR.

dtex commented 1 year ago

That's my fault. PR #1690 was submitted, and I updated the docs, but the PR was never merged because tests were failing. It's a good change, so I'll see if I can't get the test to pass rather than change the docs back.