Home Assistant Unofficial Reference 2024.12.1
__init__.py
Go to the documentation of this file.
1 """The Arve 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 ArveConfigEntry, ArveCoordinator
9 
10 PLATFORMS: list[Platform] = [Platform.SENSOR]
11 
12 
13 async def async_setup_entry(hass: HomeAssistant, entry: ArveConfigEntry) -> bool:
14  """Set up Arve from a config entry."""
15 
16  coordinator = ArveCoordinator(hass)
17 
18  await coordinator.async_config_entry_first_refresh()
19 
20  entry.runtime_data = coordinator
21 
22  await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
23 
24  return True
25 
26 
27 async def async_unload_entry(hass: HomeAssistant, entry: ArveConfigEntry) -> bool:
28  """Unload a config entry."""
29  return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
bool async_setup_entry(HomeAssistant hass, ArveConfigEntry entry)
Definition: __init__.py:13
bool async_unload_entry(HomeAssistant hass, ArveConfigEntry entry)
Definition: __init__.py:27