Skip to content

Commit

Permalink
Fetch yesterday gas data as todays might not yet be available
Browse files Browse the repository at this point in the history
  • Loading branch information
rnovacek committed Sep 12, 2023
1 parent f58f760 commit 624d10a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/cz_energy_spot_prices/spot_rate.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ async def get_gas_rates(self, start: datetime, in_eur: bool, unit: EnergyUnit) -
assert start.tzinfo, 'Timezone must be set'
start_tz = start.astimezone(self.timezone)
first_day = start_tz.date()
# today and tomorrow
query = self.get_gas_query(first_day, first_day + timedelta(days=1))
# yesteday, today and tomorrow (yesterday as we might not have today data for some time)
query = self.get_gas_query(first_day - timedelta(days=1), first_day + timedelta(days=1))

rates_task = self._get_rates(query, unit, has_hours=False)
if not in_eur:
Expand Down

0 comments on commit 624d10a

Please sign in to comment.