mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 00:07:10 +00:00
Use coordinator async_setup in dwd weather (#129448)
This commit is contained in:
parent
409c8783fe
commit
35a9d502af
@ -37,8 +37,8 @@ class DwdWeatherWarningsCoordinator(DataUpdateCoordinator[None]):
|
|||||||
self._device_tracker = None
|
self._device_tracker = None
|
||||||
self._previous_position = None
|
self._previous_position = None
|
||||||
|
|
||||||
async def async_config_entry_first_refresh(self) -> None:
|
async def _async_setup(self) -> None:
|
||||||
"""Perform first refresh."""
|
"""Set up coordinator."""
|
||||||
if region_identifier := self.config_entry.data.get(CONF_REGION_IDENTIFIER):
|
if region_identifier := self.config_entry.data.get(CONF_REGION_IDENTIFIER):
|
||||||
self.api = await self.hass.async_add_executor_job(
|
self.api = await self.hass.async_add_executor_job(
|
||||||
DwdWeatherWarningsAPI, region_identifier
|
DwdWeatherWarningsAPI, region_identifier
|
||||||
@ -48,8 +48,6 @@ class DwdWeatherWarningsCoordinator(DataUpdateCoordinator[None]):
|
|||||||
CONF_REGION_DEVICE_TRACKER
|
CONF_REGION_DEVICE_TRACKER
|
||||||
)
|
)
|
||||||
|
|
||||||
await super().async_config_entry_first_refresh()
|
|
||||||
|
|
||||||
async def _async_update_data(self) -> None:
|
async def _async_update_data(self) -> None:
|
||||||
"""Get the latest data from the DWD Weather Warnings API."""
|
"""Get the latest data from the DWD Weather Warnings API."""
|
||||||
if self._device_tracker:
|
if self._device_tracker:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user