mirror of
https://github.com/home-assistant/core.git
synced 2026-07-01 11:46:40 +01:00
d766aae436
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: frenck <195327+frenck@users.noreply.github.com>
29 lines
824 B
Python
29 lines
824 B
Python
"""The Dune HD component."""
|
|
|
|
from typing import Final
|
|
|
|
from pdunehd import DuneHDPlayer
|
|
|
|
from homeassistant.config_entries import ConfigEntry
|
|
from homeassistant.const import CONF_HOST, Platform
|
|
from homeassistant.core import HomeAssistant
|
|
|
|
PLATFORMS: Final[list[Platform]] = [Platform.MEDIA_PLAYER]
|
|
|
|
|
|
type DuneHDConfigEntry = ConfigEntry[DuneHDPlayer]
|
|
|
|
|
|
async def async_setup_entry(hass: HomeAssistant, entry: DuneHDConfigEntry) -> bool:
|
|
"""Set up a config entry."""
|
|
entry.runtime_data = DuneHDPlayer(entry.data[CONF_HOST])
|
|
|
|
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
|
|
|
|
return True
|
|
|
|
|
|
async def async_unload_entry(hass: HomeAssistant, entry: DuneHDConfigEntry) -> bool:
|
|
"""Unload a config entry."""
|
|
return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
|