mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Explicitly pass in the config_entry in ondilo_ico coordinator (#138054)
explicitly pass in the config_entry in coordinator
This commit is contained in:
parent
a0e7560b1e
commit
e050238106
@ -28,7 +28,9 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
coordinator = OndiloIcoCoordinator(hass, OndiloClient(hass, entry, implementation))
|
coordinator = OndiloIcoCoordinator(
|
||||||
|
hass, entry, OndiloClient(hass, entry, implementation)
|
||||||
|
)
|
||||||
|
|
||||||
await coordinator.async_config_entry_first_refresh()
|
await coordinator.async_config_entry_first_refresh()
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@ from typing import Any
|
|||||||
|
|
||||||
from ondilo import OndiloError
|
from ondilo import OndiloError
|
||||||
|
|
||||||
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
|
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
|
||||||
|
|
||||||
@ -28,11 +29,16 @@ class OndiloIcoData:
|
|||||||
class OndiloIcoCoordinator(DataUpdateCoordinator[dict[str, OndiloIcoData]]):
|
class OndiloIcoCoordinator(DataUpdateCoordinator[dict[str, OndiloIcoData]]):
|
||||||
"""Class to manage fetching Ondilo ICO data from API."""
|
"""Class to manage fetching Ondilo ICO data from API."""
|
||||||
|
|
||||||
def __init__(self, hass: HomeAssistant, api: OndiloClient) -> None:
|
config_entry: ConfigEntry
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self, hass: HomeAssistant, config_entry: ConfigEntry, api: OndiloClient
|
||||||
|
) -> None:
|
||||||
"""Initialize."""
|
"""Initialize."""
|
||||||
super().__init__(
|
super().__init__(
|
||||||
hass,
|
hass,
|
||||||
logger=_LOGGER,
|
logger=_LOGGER,
|
||||||
|
config_entry=config_entry,
|
||||||
name=DOMAIN,
|
name=DOMAIN,
|
||||||
update_interval=timedelta(hours=1),
|
update_interval=timedelta(hours=1),
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user