Use coordinator async_setup in dwd weather (#129448)

This commit is contained in:
G Johansson 2024-10-29 20:07:37 +01:00 committed by GitHub
parent 409c8783fe
commit 35a9d502af
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -37,8 +37,8 @@ class DwdWeatherWarningsCoordinator(DataUpdateCoordinator[None]):
self._device_tracker = None
self._previous_position = None
async def async_config_entry_first_refresh(self) -> None:
"""Perform first refresh."""
async def _async_setup(self) -> None:
"""Set up coordinator."""
if region_identifier := self.config_entry.data.get(CONF_REGION_IDENTIFIER):
self.api = await self.hass.async_add_executor_job(
DwdWeatherWarningsAPI, region_identifier
@ -48,8 +48,6 @@ class DwdWeatherWarningsCoordinator(DataUpdateCoordinator[None]):
CONF_REGION_DEVICE_TRACKER
)
await super().async_config_entry_first_refresh()
async def _async_update_data(self) -> None:
"""Get the latest data from the DWD Weather Warnings API."""
if self._device_tracker: