ofalvai / home-assistant-candy

Unofficial Candy/Haier appliance integration for Home Assistant
125 stars 30 forks source link

Rate limit API requests #214

Closed ofalvai closed 1 year ago

ofalvai commented 1 year ago

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[bot] commented 1 year ago

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%) :arrow_up:

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