Skip to content

Commit

Permalink
Merge pull request #458 from MTrab:Fix-missing-calculation-on-hour-ch…
Browse files Browse the repository at this point in the history
…ange

Fix calculations on hour change
  • Loading branch information
MTrab authored Mar 1, 2024
2 parents 32907fd + f21ace6 commit 364baa1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions custom_components/energidataservice/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,12 @@ async def new_hour(n): # type: ignore pylint: disable=unused-argument, invalid-
"""Tell the sensor to update to a new hour."""
_LOGGER.debug("New hour, updating state")

api.today = api.api_today
api.today_calculated = False
api.tomorrow = api.api_tomorrow
api.tomorrow_calculated = False
api.forecast = api.api_predictions
api.predictions_calculated = False

async_dispatcher_send(hass, UPDATE_EDS.format(entry.entry_id))

Expand Down

0 comments on commit 364baa1

Please sign in to comment.