mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 12:47:08 +00:00
Explicitly pass in the config_entry in geocaching coordinator (#137831)
explicitly pass in the config_entry in coordinator
This commit is contained in:
parent
7c9312b3cf
commit
70d5685b72
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user