1 """The WeatherflowCloud integration."""
3 from __future__
import annotations
9 from .const
import DOMAIN
10 from .coordinator
import WeatherFlowCloudDataUpdateCoordinator
12 PLATFORMS: list[Platform] = [Platform.SENSOR, Platform.WEATHER]
16 """Set up WeatherFlowCloud from a config entry."""
20 api_token=entry.data[CONF_API_TOKEN],
22 await data_coordinator.async_config_entry_first_refresh()
24 hass.data.setdefault(DOMAIN, {})[entry.entry_id] = data_coordinator
25 await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
31 """Unload a config entry."""
32 if unload_ok := await hass.config_entries.async_unload_platforms(entry, PLATFORMS):
33 hass.data[DOMAIN].pop(entry.entry_id)
bool async_setup_entry(HomeAssistant hass, ConfigEntry entry)
bool async_unload_entry(HomeAssistant hass, ConfigEntry entry)