Use eventloop for scheduling (#37184)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
This commit is contained in:
parent
0f72008090
commit
89a9634d35
42 changed files with 366 additions and 272 deletions
|
@ -8,7 +8,7 @@ from typing import Any, Awaitable, Callable, List, Optional
|
|||
import aiohttp
|
||||
|
||||
from homeassistant.core import CALLBACK_TYPE, HomeAssistant, callback
|
||||
from homeassistant.helpers.event import async_track_point_in_utc_time
|
||||
from homeassistant.helpers import event
|
||||
from homeassistant.util.dt import utcnow
|
||||
|
||||
from .debounce import Debouncer
|
||||
|
@ -99,7 +99,7 @@ class DataUpdateCoordinator:
|
|||
# minimizing the time between the point and the real activation.
|
||||
# That way we obtain a constant update frequency,
|
||||
# as long as the update process takes less than a second
|
||||
self._unsub_refresh = async_track_point_in_utc_time(
|
||||
self._unsub_refresh = event.async_track_point_in_utc_time(
|
||||
self.hass,
|
||||
self._handle_refresh_interval,
|
||||
utcnow().replace(microsecond=0) + self.update_interval,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue