2019-02-14 15:01:46 +00:00
|
|
|
"""Component for the Portuguese weather service - IPMA."""
|
2022-01-02 15:31:48 +00:00
|
|
|
from homeassistant.config_entries import ConfigEntry
|
2021-12-06 03:10:07 +00:00
|
|
|
from homeassistant.const import Platform
|
2022-01-02 15:31:48 +00:00
|
|
|
from homeassistant.core import HomeAssistant
|
2021-12-06 03:10:07 +00:00
|
|
|
|
2019-11-16 09:22:07 +00:00
|
|
|
from .config_flow import IpmaFlowHandler # noqa: F401
|
|
|
|
from .const import DOMAIN # noqa: F401
|
2019-02-08 09:55:58 +00:00
|
|
|
|
2019-07-31 19:25:30 +00:00
|
|
|
DEFAULT_NAME = "ipma"
|
2019-02-08 09:55:58 +00:00
|
|
|
|
2021-12-06 03:10:07 +00:00
|
|
|
PLATFORMS = [Platform.WEATHER]
|
2019-02-08 09:55:58 +00:00
|
|
|
|
2021-04-27 14:09:59 +00:00
|
|
|
|
2022-01-02 15:31:48 +00:00
|
|
|
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
2019-02-08 09:55:58 +00:00
|
|
|
"""Set up IPMA station as config entry."""
|
2021-04-27 14:09:59 +00:00
|
|
|
hass.config_entries.async_setup_platforms(entry, PLATFORMS)
|
2019-02-08 09:55:58 +00:00
|
|
|
return True
|
|
|
|
|
|
|
|
|
2022-01-02 15:31:48 +00:00
|
|
|
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
2019-02-08 09:55:58 +00:00
|
|
|
"""Unload a config entry."""
|
2021-04-27 14:09:59 +00:00
|
|
|
return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
|