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

Fix import and update async timeout #518

Merged
merged 1 commit into from
Nov 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions src/gridnet/gridnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,15 @@
import socket
from dataclasses import dataclass
from importlib import metadata
from typing import TYPE_CHECKING, Any, cast
from typing import Any, Self, cast

import async_timeout
from aiohttp import ClientError, ClientSession
from aiohttp.hdrs import METH_GET
from yarl import URL

from .exceptions import GridNetConnectionError
from .models import Device, SmartBridge

if TYPE_CHECKING:
from typing_extensions import Self


@dataclass
class GridNet:
Expand Down Expand Up @@ -68,7 +64,7 @@ async def _request(
self._close_session = True

try:
async with async_timeout.timeout(self.request_timeout):
async with asyncio.timeout(self.request_timeout):
response = await self.session.request(
method,
url,
Expand Down
Loading