Explicitly pass in the config_entry in youtube coordinator (#137859)

explicitly pass in the config_entry in coordinator
This commit is contained in:
Michael 2025-02-08 16:45:36 +01:00 committed by GitHub
parent 367dafdfe7
commit d07c2b8226
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions

View File

@ -36,7 +36,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
raise ConfigEntryNotReady from err
except ClientError as err:
raise ConfigEntryNotReady from err
coordinator = YouTubeDataUpdateCoordinator(hass, auth)
coordinator = YouTubeDataUpdateCoordinator(hass, entry, auth)
await coordinator.async_config_entry_first_refresh()

View File

@ -35,12 +35,15 @@ class YouTubeDataUpdateCoordinator(DataUpdateCoordinator[dict[str, Any]]):
config_entry: ConfigEntry
def __init__(self, hass: HomeAssistant, auth: AsyncConfigEntryAuth) -> None:
def __init__(
self, hass: HomeAssistant, config_entry: ConfigEntry, auth: AsyncConfigEntryAuth
) -> None:
"""Initialize the YouTube data coordinator."""
self._auth = auth
super().__init__(
hass,
LOGGER,
config_entry=config_entry,
name=DOMAIN,
update_interval=timedelta(minutes=15),
)