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