Skip to content

Commit

Permalink
Fix import and update async timeout (#509)
Browse files Browse the repository at this point in the history
  • Loading branch information
klaasnicolaas authored Nov 22, 2023
1 parent aa48329 commit ecf5c6d
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/p1monitor/p1monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,15 @@
import socket
from dataclasses import dataclass
from importlib import metadata
from typing import TYPE_CHECKING, Any, cast
from typing import Any, Mapping, Self, cast

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

from .exceptions import P1MonitorConnectionError, P1MonitorError, P1MonitorNoDataError
from .models import Phases, Settings, SmartMeter, WaterMeter

if TYPE_CHECKING:
from collections.abc import Mapping

from typing_extensions import Self


@dataclass
class P1Monitor:
Expand Down Expand Up @@ -70,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

0 comments on commit ecf5c6d

Please sign in to comment.