Home Assistant Unofficial Reference 2024.12.1
__init__.py
Go to the documentation of this file.
1 """The Palazzetti integration."""
2 
3 from __future__ import annotations
4 
5 from homeassistant.const import Platform
6 from homeassistant.core import HomeAssistant
7 
8 from .coordinator import PalazzettiConfigEntry, PalazzettiDataUpdateCoordinator
9 
10 PLATFORMS: list[Platform] = [Platform.CLIMATE, Platform.SENSOR]
11 
12 
13 async def async_setup_entry(hass: HomeAssistant, entry: PalazzettiConfigEntry) -> bool:
14  """Set up Palazzetti from a config entry."""
15 
16  coordinator = PalazzettiDataUpdateCoordinator(hass)
17 
18  await coordinator.async_config_entry_first_refresh()
19  entry.runtime_data = coordinator
20  await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
21  return True
22 
23 
24 async def async_unload_entry(hass: HomeAssistant, entry: PalazzettiConfigEntry) -> bool:
25  """Unload a config entry."""
26 
27  return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
bool async_unload_entry(HomeAssistant hass, PalazzettiConfigEntry entry)
Definition: __init__.py:24
bool async_setup_entry(HomeAssistant hass, PalazzettiConfigEntry entry)
Definition: __init__.py:13