2019-02-14 15:01:46 +00:00
|
|
|
"""Component for the Portuguese weather service - IPMA."""
|
2019-02-08 09:55:58 +00:00
|
|
|
from homeassistant.core import Config, HomeAssistant
|
2019-12-05 15:56:01 +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
|
|
|
|
|
|
|
|
|
|
|
async def async_setup(hass: HomeAssistant, config: Config) -> bool:
|
|
|
|
"""Set up configured IPMA."""
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
|
|
async def async_setup_entry(hass, config_entry):
|
|
|
|
"""Set up IPMA station as config entry."""
|
2019-07-31 19:25:30 +00:00
|
|
|
hass.async_create_task(
|
|
|
|
hass.config_entries.async_forward_entry_setup(config_entry, "weather")
|
|
|
|
)
|
2019-02-08 09:55:58 +00:00
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
|
|
async def async_unload_entry(hass, config_entry):
|
|
|
|
"""Unload a config entry."""
|
2019-07-31 19:25:30 +00:00
|
|
|
await hass.config_entries.async_forward_entry_unload(config_entry, "weather")
|
2019-02-08 09:55:58 +00:00
|
|
|
return True
|