Fix WS API: read lovelace config from .storage file directly
CI / Identify a merged version PR (push) Canceled after 0s
CI / Rust checks, rendering, and native package (push) Canceled after 0s
CI / Publish release and Homebrew feed (push) Canceled after 0s
Release PR / Maintain Version Packages PR (push) Canceled after 0s

HA 2026.10 stores dashboard configs as .storage/lovelace.{url_path}
with hyphens replaced by underscores. Direct file read is more reliable
than internal hass.data access which varies across versions.

Also added error logging to async_setup_entry for WS registration.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Kaloyan DanchevandClaude Opus 4.6 committed 2026-10-25 13:37:40 +02:00
1 parent d681f20884
commit 483b19f286
2 files changed
+37 -18

No files matched your search

@@ -1,10 +1,12 @@
"""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
from . import websocket_api
_LOGGER = logging.getLogger(__name__)
async def async_setup(hass: HomeAssistant, config: dict) -> bool:
@@ -19,7 +21,12 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
hass.data[DOMAIN][entry.entry_id] = {
"dashboard_url_path": entry.data.get("dashboard_url_path", "luma-tv"),
}
websocket_api.async_register_commands(hass)
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