Explicitly pass in the config_entry in dwd weather warnings coordinator (#137737)

This commit is contained in:
Michael 2025-02-08 01:04:45 +01:00 committed by GitHub
parent e9bfb6baee
commit 61d1b34cef
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 3 deletions

View File

@ -16,7 +16,7 @@ async def async_setup_entry(
device_registry = dr.async_get(hass)
if device_registry.async_get_device(identifiers={(DOMAIN, entry.entry_id)}):
device_registry.async_clear_config_entry(entry.entry_id)
coordinator = DwdWeatherWarningsCoordinator(hass)
coordinator = DwdWeatherWarningsCoordinator(hass, entry)
await coordinator.async_config_entry_first_refresh()
entry.runtime_data = coordinator

View File

@ -28,10 +28,16 @@ class DwdWeatherWarningsCoordinator(DataUpdateCoordinator[None]):
config_entry: DwdWeatherWarningsConfigEntry
api: DwdWeatherWarningsAPI
def __init__(self, hass: HomeAssistant) -> None:
def __init__(
self, hass: HomeAssistant, config_entry: DwdWeatherWarningsConfigEntry
) -> None:
"""Initialize the dwd_weather_warnings coordinator."""
super().__init__(
hass, LOGGER, name=DOMAIN, update_interval=DEFAULT_SCAN_INTERVAL
hass,
LOGGER,
config_entry=config_entry,
name=DOMAIN,
update_interval=DEFAULT_SCAN_INTERVAL,
)
self._device_tracker = None