diff --git a/poetry.lock b/poetry.lock index 696c5e79..3899a98e 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.4 and should not be changed by hand. [[package]] name = "aiohappyeyeballs" diff --git a/src/twentemilieu/twentemilieu.py b/src/twentemilieu/twentemilieu.py index e39675c3..f3f4c731 100644 --- a/src/twentemilieu/twentemilieu.py +++ b/src/twentemilieu/twentemilieu.py @@ -22,6 +22,8 @@ TwenteMilieuError, ) +TIMEZONE_INFO = ZoneInfo("Europe/Amsterdam") + class WasteType(IntEnum): """Enum for the types of waste.""" @@ -169,16 +171,15 @@ async def update(self) -> dict[WasteType, list[date]]: """ await self.unique_id() - timezone = ZoneInfo("Europe/Amsterdam") response = await self._request( "GetCalendar", data={ "companyCode": self.company_code, "uniqueAddressID": self._unique_id, - "startDate": (datetime.now(tz=timezone) - timedelta(days=1)) + "startDate": (datetime.now(tz=TIMEZONE_INFO) - timedelta(days=1)) .date() .isoformat(), - "endDate": (datetime.now(tz=timezone) + timedelta(days=365)) + "endDate": (datetime.now(tz=TIMEZONE_INFO) + timedelta(days=365)) .date() .isoformat(), }, @@ -197,7 +198,7 @@ async def update(self) -> dict[WasteType, list[date]]: pickup_date_raw, "%Y-%m-%dT%H:%M:%S", ) - .replace(tzinfo=timezone) + .replace(tzinfo=TIMEZONE_INFO) .date() ) pickups[waste_type].append(pickup_date)