From 9bdd8d04c5fe40338bbc78ec14ff9b4508f8d7de Mon Sep 17 00:00:00 2001 From: Michael <35783820+mib1185@users.noreply.github.com> Date: Sat, 8 Feb 2025 13:16:49 +0100 Subject: [PATCH] Explicitly pass in the config_entry in goalzero coordinator (#137836) explicitly pass in the config_entry in coordinator --- homeassistant/components/goalzero/__init__.py | 2 +- homeassistant/components/goalzero/coordinator.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/goalzero/__init__.py b/homeassistant/components/goalzero/__init__.py index 6698d1efc99..4a34927a585 100644 --- a/homeassistant/components/goalzero/__init__.py +++ b/homeassistant/components/goalzero/__init__.py @@ -36,7 +36,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: GoalZeroConfigEntry) -> except exceptions.ConnectError as ex: raise ConfigEntryNotReady(f"Failed to connect to device: {ex}") from ex - entry.runtime_data = GoalZeroDataUpdateCoordinator(hass, api) + entry.runtime_data = GoalZeroDataUpdateCoordinator(hass, entry, api) await entry.runtime_data.async_config_entry_first_refresh() await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS) diff --git a/homeassistant/components/goalzero/coordinator.py b/homeassistant/components/goalzero/coordinator.py index 3c7cd967482..97a7f537759 100644 --- a/homeassistant/components/goalzero/coordinator.py +++ b/homeassistant/components/goalzero/coordinator.py @@ -18,11 +18,14 @@ class GoalZeroDataUpdateCoordinator(DataUpdateCoordinator[None]): config_entry: GoalZeroConfigEntry - def __init__(self, hass: HomeAssistant, api: Yeti) -> None: + def __init__( + self, hass: HomeAssistant, config_entry: GoalZeroConfigEntry, api: Yeti + ) -> None: """Initialize the coordinator.""" super().__init__( hass=hass, logger=LOGGER, + config_entry=config_entry, name=DOMAIN, update_interval=timedelta(seconds=30), )