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:
@@ -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."""
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user