Home Assistant Unofficial Reference 2024.12.1
__init__.py
Go to the documentation of this file.
1 """The brunt component."""
2 
3 from __future__ import annotations
4 
5 from homeassistant.core import HomeAssistant
6 
7 from .const import PLATFORMS
8 from .coordinator import BruntConfigEntry, BruntCoordinator
9 
10 
11 async def async_setup_entry(hass: HomeAssistant, entry: BruntConfigEntry) -> bool:
12  """Set up Brunt using config flow."""
13  coordinator = BruntCoordinator(hass, entry)
14  await coordinator.async_config_entry_first_refresh()
15 
16  entry.runtime_data = coordinator
17  await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
18  return True
19 
20 
21 async def async_unload_entry(hass: HomeAssistant, entry: BruntConfigEntry) -> bool:
22  """Unload a config entry."""
23  return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
bool async_unload_entry(HomeAssistant hass, BruntConfigEntry entry)
Definition: __init__.py:21
bool async_setup_entry(HomeAssistant hass, BruntConfigEntry entry)
Definition: __init__.py:11