mirror of
https://github.com/home-assistant/core.git
synced 2026-04-02 08:26:41 +01:00
38 lines
1.2 KiB
Python
38 lines
1.2 KiB
Python
"""The html5 component."""
|
|
|
|
from homeassistant.config_entries import ConfigEntry
|
|
from homeassistant.const import Platform
|
|
from homeassistant.core import HomeAssistant
|
|
from homeassistant.helpers import config_validation as cv, discovery
|
|
from homeassistant.helpers.typing import ConfigType
|
|
|
|
from .const import DOMAIN
|
|
from .services import async_setup_services
|
|
|
|
CONFIG_SCHEMA = cv.config_entry_only_config_schema(DOMAIN)
|
|
|
|
PLATFORMS = [Platform.EVENT, Platform.NOTIFY]
|
|
|
|
|
|
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
|
"""Set up the HTML5 services."""
|
|
|
|
async_setup_services(hass)
|
|
return True
|
|
|
|
|
|
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|
"""Set up HTML5 from a config entry."""
|
|
hass.async_create_task(
|
|
discovery.async_load_platform(
|
|
hass, Platform.NOTIFY, DOMAIN, dict(entry.data), {}
|
|
)
|
|
)
|
|
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
|
|
return True
|
|
|
|
|
|
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|
"""Unload a config entry."""
|
|
return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
|