Skip to content

Commit 9ecfa70

Browse files
Fix library update time
1 parent 7eeaf6b commit 9ecfa70

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

custom_components/battery_notes/library_updater.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030

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

33-
3433
class LibraryUpdaterClientError(Exception):
3534
"""Exception to indicate a general API error."""
3635

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

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

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

6262
@callback

0 commit comments

Comments
 (0)