Explicitly pass in the config_entry in sonarr coordinator (#137938)

explicitly pass in the config_entry in coordinator
This commit is contained in:
Michael 2025-02-09 15:47:07 +01:00 committed by GitHub
parent e4ec217cfa
commit 60a3dbae41
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 7 deletions

View File

@ -67,13 +67,19 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
)
entry.async_on_unload(entry.add_update_listener(_async_update_listener))
coordinators: dict[str, SonarrDataUpdateCoordinator[Any]] = {
"upcoming": CalendarDataUpdateCoordinator(hass, host_configuration, sonarr),
"commands": CommandsDataUpdateCoordinator(hass, host_configuration, sonarr),
"diskspace": DiskSpaceDataUpdateCoordinator(hass, host_configuration, sonarr),
"queue": QueueDataUpdateCoordinator(hass, host_configuration, sonarr),
"series": SeriesDataUpdateCoordinator(hass, host_configuration, sonarr),
"status": StatusDataUpdateCoordinator(hass, host_configuration, sonarr),
"wanted": WantedDataUpdateCoordinator(hass, host_configuration, sonarr),
"upcoming": CalendarDataUpdateCoordinator(
hass, entry, host_configuration, sonarr
),
"commands": CommandsDataUpdateCoordinator(
hass, entry, host_configuration, sonarr
),
"diskspace": DiskSpaceDataUpdateCoordinator(
hass, entry, host_configuration, sonarr
),
"queue": QueueDataUpdateCoordinator(hass, entry, host_configuration, sonarr),
"series": SeriesDataUpdateCoordinator(hass, entry, host_configuration, sonarr),
"status": StatusDataUpdateCoordinator(hass, entry, host_configuration, sonarr),
"wanted": WantedDataUpdateCoordinator(hass, entry, host_configuration, sonarr),
}
# Temporary, until we add diagnostic entities
_version = None

View File

@ -48,6 +48,7 @@ class SonarrDataUpdateCoordinator(DataUpdateCoordinator[SonarrDataT]):
def __init__(
self,
hass: HomeAssistant,
config_entry: ConfigEntry,
host_configuration: PyArrHostConfiguration,
api_client: SonarrClient,
) -> None:
@ -55,6 +56,7 @@ class SonarrDataUpdateCoordinator(DataUpdateCoordinator[SonarrDataT]):
super().__init__(
hass=hass,
logger=LOGGER,
config_entry=config_entry,
name=DOMAIN,
update_interval=timedelta(seconds=30),
)