Skip to content

Commit

Permalink
Move blocking version call outside async function (#288)
Browse files Browse the repository at this point in the history
  • Loading branch information
joostlek committed Jun 8, 2024
1 parent c9f50a9 commit 57c1e85
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/aiowaqi/waqi.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
if TYPE_CHECKING:
from typing_extensions import Self

VERSION = metadata.version(__package__)


@dataclass
class WAQIClient:
Expand Down Expand Up @@ -67,15 +69,14 @@ async def _request(
WAQIAuthenticationError: Used token is invalid.
"""
version = metadata.version(__package__)
url = URL.build(
scheme="https",
host=self.api_host,
port=443,
).joinpath(uri)

headers = {
"User-Agent": f"WAQIAsync/{version}",
"User-Agent": f"WAQIAsync/{VERSION}",
"Accept": "application/json, text/plain, */*",
}

Expand Down

0 comments on commit 57c1e85

Please sign in to comment.