Skip to content

Commit

Permalink
Fix deprecation warning by using new API of async-timeout module (squ…
Browse files Browse the repository at this point in the history
  • Loading branch information
niclasku authored Jun 19, 2023
1 parent e17c930 commit 599d794
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions solax/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import asyncio
import logging

import async_timeout
from async_timeout import timeout

from solax.discovery import discover
from solax.inverter import Inverter, InverterResponse
Expand All @@ -22,7 +22,7 @@ async def rt_request(inv: Inverter, retry, t_wait=0) -> InverterResponse:
new_wait = (t_wait * 2) + 5
retry = retry - 1
try:
with async_timeout.timeout(REQUEST_TIMEOUT):
async with timeout(REQUEST_TIMEOUT):
return await inv.get_data()
except asyncio.TimeoutError:
if retry > 0:
Expand Down

0 comments on commit 599d794

Please sign in to comment.