Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated rate limit statuscode #144

Merged
merged 2 commits into from
Aug 3, 2022
Merged

Updated rate limit statuscode #144

merged 2 commits into from
Aug 3, 2022

Conversation

mvdwetering
Copy link
Contributor

On the Hue developer website there is a message about the rate limiting status code being updated https://developers.meethue.com/rate-limiting-status-code/

Quoted below for convenience

Dear developers,

The next Hue Bridge firmware release contains a change to the HTTP status code we respond with when your client exceeds the request rate limit. Previously this would return the wrong status code 503, and going forward the correct status code will be 429.

This only applies to HTTPS connections. The 503 status code can still happen, but only if the service you try to communicate with is temporarily unavailable (i.e. server side issue), whereas 429 will happen if your application is making to many requests in a short period of time (i.e. client side issue).

Hue Developer Support

Since there is no specific bridge version mentioned I just added the 429 code same as 503 was done. This allows to work with bridges still on "before" versions and my assumption is that backing off when the service is temporarily unvailable is not a big issue.

aiohue/v1/__init__.py Outdated Show resolved Hide resolved
aiohue/v2/__init__.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@marcelveldt marcelveldt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

besides the small comment this is nice, thanks!

@mvdwetering
Copy link
Contributor Author

I moved the comments

@marcelveldt marcelveldt merged commit a5e846f into home-assistant-libs:master Aug 3, 2022
@marcelveldt
Copy link
Collaborator

Thanks!

@mvdwetering mvdwetering deleted the change_ratelimit_status_code branch August 4, 2022 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants