Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch hassio to use async_call_later #99216

Merged
merged 1 commit into from
Aug 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions homeassistant/components/hassio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
)
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.helpers.device_registry import DeviceInfo
from homeassistant.helpers.event import async_track_point_in_utc_time
from homeassistant.helpers.event import async_call_later
from homeassistant.helpers.storage import Store
from homeassistant.helpers.typing import ConfigType
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
Expand Down Expand Up @@ -535,10 +535,10 @@ async def update_info_data(_: datetime | None = None) -> None:
except HassioAPIError as err:
_LOGGER.warning("Can't read Supervisor data: %s", err)

async_track_point_in_utc_time(
async_call_later(
hass,
HASSIO_UPDATE_INTERVAL,
HassJob(update_info_data, cancel_on_shutdown=True),
utcnow() + HASSIO_UPDATE_INTERVAL,
)

# Fetch data
Expand Down Expand Up @@ -610,10 +610,10 @@ async def _async_setup_hardware_integration(_: datetime | None = None) -> None:
"""Set up hardaware integration for the detected board type."""
if (os_info := get_os_info(hass)) is None:
# os info not yet fetched from supervisor, retry later
async_track_point_in_utc_time(
async_call_later(
hass,
HASSIO_UPDATE_INTERVAL,
async_setup_hardware_integration_job,
utcnow() + HASSIO_UPDATE_INTERVAL,
)
return
if (board := os_info.get("board")) is None:
Expand Down