Skip to content

Commit

Permalink
Fix library update time
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-codechimp committed Dec 4, 2024
1 parent 7eeaf6b commit 9ecfa70
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions custom_components/battery_notes/library_updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@

BUILT_IN_DATA_DIRECTORY = os.path.join(os.path.dirname(__file__), "data")


class LibraryUpdaterClientError(Exception):
"""Exception to indicate a general API error."""

Expand All @@ -54,9 +53,10 @@ def __init__(self, hass: HomeAssistant):

self._client = LibraryUpdaterClient(library_url=url, session=async_get_clientsession(hass))

# Fire the library check every 24 hours from now
# Fire the library check every 24 hours from just before now
refresh_time = datetime.now() - timedelta(hours=0, minutes=1)
async_track_utc_time_change(
hass, self.timer_update, hour=datetime.now().hour, minute=datetime.now().minute, second=datetime.now().second, local=True
hass, self.timer_update, hour=refresh_time.hour, minute=refresh_time.minute, second=refresh_time.second, local=True
)

@callback
Expand Down

0 comments on commit 9ecfa70

Please sign in to comment.