sbidy / pywizlight

A python connector for WiZ devices
MIT License
463 stars 79 forks source link

Implement progressive backoff and improve error reporting #126

Closed bdraco closed 2 years ago

bdraco commented 2 years ago

We needed to wait a little bit longer for the OSError's to come back so we now backoff progressively up to 3s between sends and increases the timeout to 13s since it can take a few more seconds for error to arrive. This means we now get a much better error when the bulb is offline, and we aren't making a situation where the problem is wifi congestion even worse.

Also since we are using a future, it doesn't matter which udp message the bulb gets and respond to, since as soon as it does, the send task will be canceled and we will declare success.

Screen Shot 2022-02-13 at 09 04 10 Screen Shot 2022-02-13 at 09 04 04
codecov-commenter commented 2 years ago

Codecov Report

Merging #126 (c06e767) into master (ed71ae3) will increase coverage by 0.09%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #126      +/-   ##
==========================================
+ Coverage   87.34%   87.43%   +0.09%     
==========================================
  Files          12       12              
  Lines         782      788       +6     
==========================================
+ Hits          683      689       +6     
  Misses         99       99              
Impacted Files Coverage Δ
pywizlight/bulb.py 89.84% <100.00%> (+0.16%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update ed71ae3...c06e767. Read the comment docs.

bdraco commented 2 years ago

It would be good to get a release for this one.

sbidy commented 2 years ago

0.5.7 on the way