TuyaAPI / link

📡 Effortlessly connect devices to WiFi and the cloud. Documentation: https://tuyaapi.github.io/link.
MIT License
15 stars 10 forks source link

Speed Up Link by allowing polling to begin while register is still runnning #2

Closed dedvalson closed 6 years ago

dedvalson commented 6 years ago

The comment said // While UDP packets are being sent, start polling for device but that wasn't true. I fixed it to make it true, runs much faster

codetheweb commented 6 years ago

Thanks; I guess I planned to change the loop but never did.

Would you mind fixing the xo error? You can check it locally by running npm i xo -g and then npm test.

I won't be able to look at this / merge it until Monday.

dedvalson commented 6 years ago

I fixed the XO error. Please review the code before you pull it. I have been writing in C++ for over 30 years but I am very new to node.js, I may have done things the hard way, especially with the abort code.

codetheweb commented 6 years ago

Fixed some stuff and looks good now.

Personally, polling Tuya's API during the setup process doesn't make it any faster for me, but it may for other people. It does make more sense than what I had originally.

I'll bump the version and publish to NPM after merge.