diff --git a/src/p1monitor/p1monitor.py b/src/p1monitor/p1monitor.py index 2760391..ffdc7b9 100644 --- a/src/p1monitor/p1monitor.py +++ b/src/p1monitor/p1monitor.py @@ -5,9 +5,8 @@ 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 @@ -15,11 +14,6 @@ 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: @@ -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,