Home Assistant Unofficial Reference 2024.12.1
__init__.py
Go to the documentation of this file.
1 """The dlna_dmr component."""
2 
3 from __future__ import annotations
4 
5 from homeassistant import config_entries
6 from homeassistant.const import Platform
7 from homeassistant.core import HomeAssistant
8 
9 from .const import LOGGER
10 
11 PLATFORMS = [Platform.MEDIA_PLAYER]
12 
13 
15  hass: HomeAssistant, entry: config_entries.ConfigEntry
16 ) -> bool:
17  """Set up a DLNA DMR device from a config entry."""
18  LOGGER.debug("Setting up config entry: %s", entry.unique_id)
19 
20  # Forward setup to the appropriate platform
21  await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
22 
23  return True
24 
25 
27  hass: HomeAssistant, config_entry: config_entries.ConfigEntry
28 ) -> bool:
29  """Unload a config entry."""
30  # Forward to the same platform as async_setup_entry did
31  return await hass.config_entries.async_unload_platforms(config_entry, PLATFORMS)
bool async_unload_entry(HomeAssistant hass, config_entries.ConfigEntry config_entry)
Definition: __init__.py:28
bool async_setup_entry(HomeAssistant hass, config_entries.ConfigEntry entry)
Definition: __init__.py:16