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

Rate limit API requests #214

Merged
merged 4 commits into from
Nov 14, 2022
Merged

Rate limit API requests #214

merged 4 commits into from
Nov 14, 2022

Conversation

ofalvai
Copy link
Owner

@ofalvai ofalvai commented Nov 14, 2022

Add a global rate limiter for any API request the integration makes. Some devices can't handle too frequent requests and respond with BAD_REQUEST.

This solves some (but not all!) issues reported in #61, #53

@codecov
Copy link

codecov bot commented Nov 14, 2022

Codecov Report

Merging #214 (34db0b6) into main (6b21deb) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #214   +/-   ##
=======================================
  Coverage   97.98%   97.99%           
=======================================
  Files           7        7           
  Lines         597      599    +2     
=======================================
+ Hits          585      587    +2     
  Misses         12       12           
Impacted Files Coverage Δ
custom_components/candy/client/__init__.py 97.22% <100.00%> (+0.07%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@ofalvai ofalvai merged commit 7a79280 into main Nov 14, 2022
@ofalvai ofalvai deleted the request-limiter branch November 14, 2022 08:28
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.

1 participant