diff --git a/homeassistant/components/youless/__init__.py b/homeassistant/components/youless/__init__.py index 03a27b5a378..af14d597b79 100644 --- a/homeassistant/components/youless/__init__.py +++ b/homeassistant/components/youless/__init__.py @@ -27,7 +27,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: except URLError as exception: raise ConfigEntryNotReady from exception - youless_coordinator = YouLessCoordinator(hass, api) + youless_coordinator = YouLessCoordinator(hass, entry, api) await youless_coordinator.async_config_entry_first_refresh() hass.data.setdefault(DOMAIN, {}) diff --git a/homeassistant/components/youless/coordinator.py b/homeassistant/components/youless/coordinator.py index 0be5e463689..81e4b3a4c76 100644 --- a/homeassistant/components/youless/coordinator.py +++ b/homeassistant/components/youless/coordinator.py @@ -5,6 +5,7 @@ import logging from youless_api import YoulessAPI +from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant from homeassistant.helpers.update_coordinator import DataUpdateCoordinator @@ -14,10 +15,18 @@ _LOGGER = logging.getLogger(__name__) class YouLessCoordinator(DataUpdateCoordinator[None]): """Class to manage fetching YouLess data.""" - def __init__(self, hass: HomeAssistant, device: YoulessAPI) -> None: + config_entry: ConfigEntry + + def __init__( + self, hass: HomeAssistant, config_entry: ConfigEntry, device: YoulessAPI + ) -> None: """Initialize global YouLess data provider.""" super().__init__( - hass, _LOGGER, name="youless_gateway", update_interval=timedelta(seconds=10) + hass, + _LOGGER, + config_entry=config_entry, + name="youless_gateway", + update_interval=timedelta(seconds=10), ) self.device = device