1 """The buienradar integration."""
3 from __future__
import annotations
9 from .util
import BrData
11 PLATFORMS = [Platform.CAMERA, Platform.SENSOR, Platform.WEATHER]
13 type BuienRadarConfigEntry = ConfigEntry[dict[Platform, BrData]]
17 """Set up buienradar from a config entry."""
18 entry.runtime_data = {}
19 await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
20 entry.async_on_unload(entry.add_update_listener(async_update_options))
25 """Unload a config entry."""
26 if unload_ok := await hass.config_entries.async_unload_platforms(entry, PLATFORMS):
27 for platform
in PLATFORMS:
28 if (data := entry.runtime_data.get(platform))
and (
29 unsub := data.unsub_schedule_update
37 hass: HomeAssistant, config_entry: BuienRadarConfigEntry
40 await hass.config_entries.async_reload(config_entry.entry_id)
bool async_setup_entry(HomeAssistant hass, BuienRadarConfigEntry entry)
bool async_unload_entry(HomeAssistant hass, BuienRadarConfigEntry entry)
None async_update_options(HomeAssistant hass, BuienRadarConfigEntry config_entry)