sinricpro / nodejs-sdk

Nodejs library for https://sinric.pro
11 stars 7 forks source link

Using the basic example provided is showing "Too many events!" after about 20 seconds #20

Closed drewklein20 closed 2 years ago

drewklein20 commented 2 years ago

Does a free account only allow a set amount of requests per second to Sinricpro? I noticed after changing the setInterval timeout to 8000 instead of 2000 I didn't see the message. If this isn't a limitation of the account type and purely a limit to all accounts then the example should explain this.

kakopappa commented 2 years ago

Hi @drewklein20, There's a message rate limiter built into the SDK to protect the server from flooding with data. Please review your code and send events when the state has been changed or there's a significant change. We will update the examples

drewklein20 commented 2 years ago

Yes this makes sense. What's confusing is the example you have provided is set up on a 2 second interval to fire an event to the server. I simply ran the example code and was seeing the "Too many messages" error. I guess I don't really see the benefit of using the setInterval in the example? I initially thought it was needed for the sdk to work properly which isn't the case

drewklein20 commented 2 years ago

Sorry, just re-read your response and must have missed the last sentence. Thanks!