"""Luma Home — config bridge between HA dashboards and Luma TV app.""" import logging from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant from .const import DOMAIN _LOGGER = logging.getLogger(__name__) async def async_setup(hass: HomeAssistant, config: dict) -> bool: """Set up the Luma Home component.""" hass.data.setdefault(DOMAIN, {}) return True async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: """Set up Luma Home from a config entry.""" hass.data.setdefault(DOMAIN, {}) hass.data[DOMAIN][entry.entry_id] = { "dashboard_url_path": entry.data.get("dashboard_url_path", "luma-tv"), } try: from . import websocket_api websocket_api.async_register_commands(hass) _LOGGER.info("Luma Home WS commands registered successfully") except Exception: _LOGGER.exception("Failed to register Luma Home WS commands") return True async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: """Unload a config entry.""" hass.data[DOMAIN].pop(entry.entry_id, None) return True