michielpost / Q42.HueApi

C# helper library to talk to the Philips Hue bridge
MIT License
411 stars 114 forks source link

Should there be a 100ms delay between LightCommands in SendRawCommand? #119

Closed niels9001 closed 7 years ago

niels9001 commented 7 years ago

The SendCommand(LightCommand Cmd, List LightIds) allows the client to send multiple single light commands at the same time. Should the code include a 100ms pause between commands or what would be the best way to do this?

Conclusion As a general guideline we always recommend to our developers to stay at roughly 10 commands per second to the /lights resource with a 100ms gap between each API call. For /groups commands you should keep to a maximum of 1 per second. It is however always recommended to take into consideration the above information and to of course stress test your app/system to find the optimal values for your application.

https://developers.meethue.com/content/time-increments-less-one-second

michielpost commented 7 years ago

A 100ms delay is not something I'm going to include in the Q42.HueApi library, it's the responsibility of the developer using the Hue API. This library is just an easy proxy between C# and the Hue API.

If you want to hammer the API with 1000 requests per second, you can do that. This library is not going to limit that.

niels9001 commented 7 years ago

Yep, you're right.