From 92234f86e8da5f55ac265b0aa14592f91a78d290 Mon Sep 17 00:00:00 2001 From: Michael <35783820+mib1185@users.noreply.github.com> Date: Sat, 8 Feb 2025 12:46:51 +0100 Subject: [PATCH] Explicitly pass in the config_entry in aseko_pool_live coordinator init (#137711) explicitly pass in the config_entry in aseko_pool_live coordinator init --- homeassistant/components/aseko_pool_live/__init__.py | 2 +- homeassistant/components/aseko_pool_live/coordinator.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/aseko_pool_live/__init__.py b/homeassistant/components/aseko_pool_live/__init__.py index 52d74398818..012b5a19b0f 100644 --- a/homeassistant/components/aseko_pool_live/__init__.py +++ b/homeassistant/components/aseko_pool_live/__init__.py @@ -26,7 +26,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: AsekoConfigEntry) -> boo except AsekoNotLoggedIn as err: raise ConfigEntryAuthFailed from err - coordinator = AsekoDataUpdateCoordinator(hass, aseko) + coordinator = AsekoDataUpdateCoordinator(hass, entry, aseko) await coordinator.async_config_entry_first_refresh() entry.runtime_data = coordinator await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS) diff --git a/homeassistant/components/aseko_pool_live/coordinator.py b/homeassistant/components/aseko_pool_live/coordinator.py index 96893912361..d54aa756ddd 100644 --- a/homeassistant/components/aseko_pool_live/coordinator.py +++ b/homeassistant/components/aseko_pool_live/coordinator.py @@ -21,13 +21,18 @@ type AsekoConfigEntry = ConfigEntry[AsekoDataUpdateCoordinator] class AsekoDataUpdateCoordinator(DataUpdateCoordinator[dict[str, Unit]]): """Class to manage fetching Aseko unit data from single endpoint.""" - def __init__(self, hass: HomeAssistant, aseko: Aseko) -> None: + config_entry: AsekoConfigEntry + + def __init__( + self, hass: HomeAssistant, config_entry: AsekoConfigEntry, aseko: Aseko + ) -> None: """Initialize global Aseko unit data updater.""" self._aseko = aseko super().__init__( hass, _LOGGER, + config_entry=config_entry, name=DOMAIN, update_interval=timedelta(minutes=2), )