Skip to content

Commit

Permalink
Refactor version retrieval in ParkingStockholm class
Browse files Browse the repository at this point in the history
  • Loading branch information
klaasnicolaas committed Nov 13, 2024
1 parent 1352ffc commit 74a45f7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/odp_stockholm/odp_stockholm.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
from .exceptions import ODPStockholmConnectionError, ODPStockholmError
from .models import DisabledParking

VERSION = metadata.version(__package__)


@dataclass
class ParkingStockholm:
Expand Down Expand Up @@ -54,7 +56,6 @@ async def _request(
the Open Data Platform API of Stockholm.
"""
version = metadata.version(__package__)
url = URL.build(
scheme="https",
host="openparking.stockholm.se",
Expand All @@ -65,7 +66,7 @@ async def _request(

headers = {
"Accept": "application/json",
"User-Agent": f"PythonODPStockholm/{version}",
"User-Agent": f"PythonODPStockholm/{VERSION}",
}

if self.session is None:
Expand Down

0 comments on commit 74a45f7

Please sign in to comment.