Home Assistant Unofficial Reference 2024.12.1
__init__.py
Go to the documentation of this file.
1 """The Steam 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 SteamDataUpdateCoordinator
10 
11 PLATFORMS = [Platform.SENSOR]
12 type SteamConfigEntry = ConfigEntry[SteamDataUpdateCoordinator]
13 
14 
15 async def async_setup_entry(hass: HomeAssistant, entry: SteamConfigEntry) -> bool:
16  """Set up Steam from a config entry."""
17  coordinator = SteamDataUpdateCoordinator(hass)
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 
22  return True
23 
24 
25 async def async_unload_entry(hass: HomeAssistant, entry: SteamConfigEntry) -> bool:
26  """Unload a config entry."""
27  return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
bool async_unload_entry(HomeAssistant hass, SteamConfigEntry entry)
Definition: __init__.py:25
bool async_setup_entry(HomeAssistant hass, SteamConfigEntry entry)
Definition: __init__.py:15