Skip to content

Commit

Permalink
Move version metadata to outside the EasyEnergy class (#445)
Browse files Browse the repository at this point in the history
  • Loading branch information
klaasnicolaas authored Jun 28, 2024
1 parent 22a1b29 commit 9f71df5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/easyenergy/easyenergy.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
)
from .models import Electricity, Gas

VERSION = metadata.version(__package__)


@dataclass
class EasyEnergy:
Expand Down Expand Up @@ -61,8 +63,6 @@ async def _request(
the API.
"""
version = metadata.version(__package__)

# EasyEnergy is experiencing IPv6 connection issues.
# DNS returns an AAAA record with an IPv6 address, but
# there doesn't appear to be something listening at that.
Expand All @@ -86,7 +86,7 @@ async def _request(

headers = {
"Accept": "application/json, text/plain",
"User-Agent": f"PythonEasyEnergy/{version}",
"User-Agent": f"PythonEasyEnergy/{VERSION}",
"Host": API_HOST,
}

Expand Down

0 comments on commit 9f71df5

Please sign in to comment.