2020-08-10 13:51:04 +00:00
|
|
|
"""UK Environment Agency Flood Monitoring Integration."""
|
2021-12-31 10:05:44 +00:00
|
|
|
from homeassistant.config_entries import ConfigEntry
|
2021-12-28 20:13:20 +00:00
|
|
|
from homeassistant.const import Platform
|
2021-12-31 10:05:44 +00:00
|
|
|
from homeassistant.core import HomeAssistant
|
2021-12-28 20:13:20 +00:00
|
|
|
|
2020-08-10 13:51:04 +00:00
|
|
|
from .const import DOMAIN
|
|
|
|
|
2021-12-28 20:13:20 +00:00
|
|
|
PLATFORMS = [Platform.SENSOR]
|
2020-08-10 13:51:04 +00:00
|
|
|
|
|
|
|
|
2021-12-31 10:05:44 +00:00
|
|
|
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
2020-08-10 13:51:04 +00:00
|
|
|
"""Set up flood monitoring sensors for this config entry."""
|
2021-04-27 06:46:49 +00:00
|
|
|
hass.data.setdefault(DOMAIN, {})
|
|
|
|
hass.config_entries.async_setup_platforms(entry, PLATFORMS)
|
2020-08-10 13:51:04 +00:00
|
|
|
return True
|
|
|
|
|
|
|
|
|
2021-12-31 10:05:44 +00:00
|
|
|
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
2020-08-10 13:51:04 +00:00
|
|
|
"""Unload flood monitoring sensors."""
|
2021-04-27 06:46:49 +00:00
|
|
|
return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
|