Skip to content

Commit

Permalink
Move fetching of tariffs to data refresh time
Browse files Browse the repository at this point in the history
  • Loading branch information
MTrab committed Sep 29, 2023
1 parent a5a394d commit 1f47c80
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/energidataservice/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ async def new_day(n): # type: ignore pylint: disable=unused-argument, invalid-n
"""Handle data on new day."""
_LOGGER.debug("New day function called")

await api.async_get_tariffs()

api.today = api.api_tomorrow
api.today_calculated = False
api.api_today = api.api_tomorrow
Expand All @@ -112,6 +110,8 @@ async def get_new_data(n): # type: ignore pylint: disable=unused-argument, inva
_LOGGER.debug("Getting latest dataset")
await api.update()
await api.update_carnot()
await api.async_get_tariffs()

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

async def update_carnot(n): # type: ignore pylint: disable=unused-argument, invalid-name
Expand Down

0 comments on commit 1f47c80

Please sign in to comment.