Skip to content

Commit

Permalink
Change UTC time to LOCAL time
Browse files Browse the repository at this point in the history
  • Loading branch information
MTrab committed Jun 22, 2023
1 parent a69092a commit 819e2e6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions custom_components/energidataservice/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from homeassistant.helpers.dispatcher import async_dispatcher_send
from homeassistant.helpers.event import (
async_call_later,
async_track_utc_time_change,
async_track_time_change,
)
from homeassistant.loader import async_get_integration

Expand Down Expand Up @@ -130,23 +130,23 @@ async def update_carnot(n): # type: ignore pylint: disable=unused-argument, inv
async_dispatcher_send(hass, UPDATE_EDS.format(entry.entry_id))

# Handle dataset updates
update_tomorrow = async_track_utc_time_change(
update_tomorrow = async_track_time_change(
hass,
get_new_data,
hour=12, # UTC time!!
hour=12, # LOCAL time!!
minute=rand_min,
second=rand_sec,
)

update_new_day = async_track_utc_time_change(
update_new_day = async_track_time_change(
hass,
new_day,
hour=0, # UTC time!!
hour=0, # LOCAL time!!
minute=0,
second=0,
)

update_new_hour = async_track_utc_time_change(hass, new_hour, minute=0, second=1)
update_new_hour = async_track_time_change(hass, new_hour, minute=0, second=1)

if use_forecast:
async_call_later(hass, CARNOT_UPDATE, update_carnot)
Expand Down

0 comments on commit 819e2e6

Please sign in to comment.