Skip to content

Commit

Permalink
Apply the formatting again
Browse files Browse the repository at this point in the history
  • Loading branch information
Pluimvee committed Oct 8, 2024
1 parent 0d07dcc commit 139449d
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions custom_components/entsoe/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,10 +239,17 @@ def get_timestamped_prices(self, hourprices):
# we could still optimize as not every calculator mode needs hourly updates
def sync_calculator(self):
now = dt.now()
if self.calculator_last_sync is None or self.calculator_last_sync.hour != now.hour:
self.logger.debug(f"The calculator needs to be synced with the current time")
if (
self.calculator_last_sync is None
or self.calculator_last_sync.hour != now.hour
):
self.logger.debug(
f"The calculator needs to be synced with the current time"
)
if self.today.date() != now.date():
self.logger.debug(f"new day detected: update today and filtered hourprices")
self.logger.debug(
f"new day detected: update today and filtered hourprices"
)
self.today = now.replace(hour=0, minute=0, second=0, microsecond=0)
self.filtered_hourprices = self._filter_calculated_hourprices(self.data)

Expand Down

0 comments on commit 139449d

Please sign in to comment.