Skip to content

Commit

Permalink
Use max_tries instead max_time to stabalize retry count
Browse files Browse the repository at this point in the history
  • Loading branch information
DCSBL committed Aug 17, 2024
1 parent 41a15e5 commit f9cb7dd
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
Binary file modified .coverage
Binary file not shown.
2 changes: 1 addition & 1 deletion homewizard_energy/homewizard_energy.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ async def identify(
await self.request("api/v1/identify", method=METH_PUT)
return True

@backoff.on_exception(backoff.expo, RequestError, max_time=3)
@backoff.on_exception(backoff.expo, RequestError, max_tries=5)
async def request(
self, path: str, method: str = METH_GET, data: object = None
) -> Any:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_homewizard_energy.py
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ async def test_request_timeout():
with pytest.raises(RequestError):
await api.request("api/v1/data")

assert api._session.request.call_count == 4
assert api._session.request.call_count == 5


async def test_close_when_out_of_scope():
Expand Down

0 comments on commit f9cb7dd

Please sign in to comment.