core/homeassistant/components/dunehd/__init__.py

31 lines
860 B
Python
Raw Normal View History

"""The Dune HD component."""
from __future__ import annotations
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]
2025-01-24 14:45:34 +00:00
type DuneHDConfigEntry = ConfigEntry[DuneHDPlayer]
2025-01-24 14:45:34 +00:00
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
2025-01-24 14:45:34 +00:00
async def async_unload_entry(hass: HomeAssistant, entry: DuneHDConfigEntry) -> bool:
"""Unload a config entry."""
2025-01-24 14:45:34 +00:00
return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)