From 70d5685b729b23ae155c42c66687dcc94fd8ee6e Mon Sep 17 00:00:00 2001 From: Michael <35783820+mib1185@users.noreply.github.com> Date: Sat, 8 Feb 2025 15:34:43 +0100 Subject: [PATCH] Explicitly pass in the config_entry in geocaching coordinator (#137831) explicitly pass in the config_entry in coordinator --- homeassistant/components/geocaching/coordinator.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/geocaching/coordinator.py b/homeassistant/components/geocaching/coordinator.py index 8f56cd9d846..41b59d049af 100644 --- a/homeassistant/components/geocaching/coordinator.py +++ b/homeassistant/components/geocaching/coordinator.py @@ -18,12 +18,13 @@ from .const import DOMAIN, ENVIRONMENT, LOGGER, UPDATE_INTERVAL class GeocachingDataUpdateCoordinator(DataUpdateCoordinator[GeocachingStatus]): """Class to manage fetching Geocaching data from single endpoint.""" + config_entry: ConfigEntry + def __init__( self, hass: HomeAssistant, *, entry: ConfigEntry, session: OAuth2Session ) -> None: """Initialize global Geocaching data updater.""" self.session = session - self.entry = entry async def async_token_refresh() -> str: await session.async_ensure_token_valid() @@ -39,7 +40,13 @@ class GeocachingDataUpdateCoordinator(DataUpdateCoordinator[GeocachingStatus]): token_refresh_method=async_token_refresh, ) - super().__init__(hass, LOGGER, name=DOMAIN, update_interval=UPDATE_INTERVAL) + super().__init__( + hass, + LOGGER, + config_entry=entry, + name=DOMAIN, + update_interval=UPDATE_INTERVAL, + ) async def _async_update_data(self) -> GeocachingStatus: try: