Explicitly pass in the config_entry in goalzero coordinator (#137836)

explicitly pass in the config_entry in coordinator
This commit is contained in:
Michael 2025-02-08 13:16:49 +01:00 committed by GitHub
parent 39d6aaf294
commit 9bdd8d04c5
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: 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)

View File

@ -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),
)