1
0
mirror of https://github.com/home-assistant/supervisor.git synced 2025-12-19 18:08:40 +00:00

Make sure Core returns a valid config

This commit is contained in:
Stefan Agner
2025-11-13 17:49:41 +01:00
parent 5d3a568b48
commit febfaf8db1
2 changed files with 4 additions and 5 deletions

View File

@@ -175,7 +175,10 @@ class HomeAssistantAPI(CoreSysAttributes):
async def get_config(self) -> dict[str, Any]:
"""Return Home Assistant config."""
return await self._get_json("api/config")
config = await self._get_json("api/config")
if config is None or not isinstance(config, dict):
raise HomeAssistantAPIError("No config received from Home Assistant API")
return config
async def get_core_state(self) -> dict[str, Any]:
"""Return Home Assistant core state."""

View File

@@ -305,10 +305,6 @@ class HomeAssistantCore(JobGroup):
self._error_state = True
return
if data is None:
self._error_state = True
return
# Verify that the frontend is loaded
if "frontend" not in data.get("components", []):
_LOGGER.error("API responds but frontend is not loaded")