1 """The Holiday integration."""
3 from __future__
import annotations
5 from functools
import partial
7 from holidays
import country_holidays
14 from .const
import CONF_PROVINCE
16 PLATFORMS: list[Platform] = [Platform.CALENDAR]
20 """Set up Holiday from a config entry."""
21 country: str = entry.data[CONF_COUNTRY]
22 province: str |
None = entry.data.get(CONF_PROVINCE)
31 await hass.async_add_import_executor_job(
32 partial(country_holidays, country, subdiv=province)
35 await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
41 """Unload a config entry."""
42 return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
bool async_setup_entry(HomeAssistant hass, ConfigEntry entry)
bool async_unload_entry(HomeAssistant hass, ConfigEntry entry)
Generator[None] async_pause_setup(core.HomeAssistant hass, SetupPhases phase)