Skip to content

Commit

Permalink
Replace deprecated hass.helpers usage (#3608)
Browse files Browse the repository at this point in the history
* Replace deprecated hass.helpers usage

* Add missing hass argument (tests are NICE!)

---------

Co-authored-by: Jan-Philipp Benecke <[email protected]>
Co-authored-by: ludeeus <[email protected]>
  • Loading branch information
3 people authored Apr 11, 2024
1 parent cf80a76 commit 90f1d8a
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions custom_components/hacs/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
from homeassistant.const import EVENT_HOMEASSISTANT_FINAL_WRITE, Platform
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.dispatcher import async_dispatcher_send
from homeassistant.helpers.event import async_track_time_interval
from homeassistant.helpers.issue_registry import IssueSeverity, async_create_issue
from homeassistant.loader import Integration
from homeassistant.util import dt
Expand Down Expand Up @@ -630,50 +631,48 @@ async def startup_tasks(self, _=None) -> None:

if not self.configuration.experimental:
self.recurring_tasks.append(
self.hass.helpers.event.async_track_time_interval(
self.async_update_downloaded_repositories, timedelta(hours=48)
async_track_time_interval(
self.hass, self.async_update_downloaded_repositories, timedelta(hours=48)
)
)
self.recurring_tasks.append(
self.hass.helpers.event.async_track_time_interval(
async_track_time_interval(
self.hass,
self.async_update_all_repositories,
timedelta(hours=96),
)
)
else:
self.recurring_tasks.append(
self.hass.helpers.event.async_track_time_interval(
async_track_time_interval(
self.hass,
self.async_load_hacs_from_github,
timedelta(hours=48),
)
)

self.recurring_tasks.append(
self.hass.helpers.event.async_track_time_interval(
self.async_update_downloaded_custom_repositories, timedelta(hours=48)
async_track_time_interval(
self.hass, self.async_update_downloaded_custom_repositories, timedelta(hours=48)
)
)

self.recurring_tasks.append(
self.hass.helpers.event.async_track_time_interval(
self.async_get_all_category_repositories, timedelta(hours=6)
async_track_time_interval(
self.hass, self.async_get_all_category_repositories, timedelta(hours=6)
)
)

self.recurring_tasks.append(
self.hass.helpers.event.async_track_time_interval(
self.async_check_rate_limit, timedelta(minutes=5)
)
async_track_time_interval(self.hass, self.async_check_rate_limit, timedelta(minutes=5))
)
self.recurring_tasks.append(
self.hass.helpers.event.async_track_time_interval(
self.async_prosess_queue, timedelta(minutes=10)
)
async_track_time_interval(self.hass, self.async_prosess_queue, timedelta(minutes=10))
)

self.recurring_tasks.append(
self.hass.helpers.event.async_track_time_interval(
self.async_handle_critical_repositories, timedelta(hours=6)
async_track_time_interval(
self.hass, self.async_handle_critical_repositories, timedelta(hours=6)
)
)

Expand Down

0 comments on commit 90f1d8a

Please sign in to comment.