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
pull/137714/merge
Michael 2025-02-08 12:46:51 +01:00 committed by GitHub
parent c71116cc12
commit 92234f86e8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 2 deletions

View File

@ -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)

View File

@ -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),
)