1 """The dwd_weather_warnings component."""
3 from __future__
import annotations
8 from .const
import DOMAIN, PLATFORMS
9 from .coordinator
import DwdWeatherWarningsConfigEntry, DwdWeatherWarningsCoordinator
13 hass: HomeAssistant, entry: DwdWeatherWarningsConfigEntry
15 """Set up a config entry."""
16 device_registry = dr.async_get(hass)
17 if device_registry.async_get_device(identifiers={(DOMAIN, entry.entry_id)}):
18 device_registry.async_clear_config_entry(entry.entry_id)
20 await coordinator.async_config_entry_first_refresh()
22 entry.runtime_data = coordinator
23 await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
29 hass: HomeAssistant, entry: DwdWeatherWarningsConfigEntry
31 """Unload a config entry."""
32 return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
bool async_setup_entry(HomeAssistant hass, DwdWeatherWarningsConfigEntry entry)
bool async_unload_entry(HomeAssistant hass, DwdWeatherWarningsConfigEntry entry)