mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-12-20 02:18:59 +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]:
|
async def get_config(self) -> dict[str, Any]:
|
||||||
"""Return Home Assistant config."""
|
"""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]:
|
async def get_core_state(self) -> dict[str, Any]:
|
||||||
"""Return Home Assistant core state."""
|
"""Return Home Assistant core state."""
|
||||||
|
|||||||
@@ -305,10 +305,6 @@ class HomeAssistantCore(JobGroup):
|
|||||||
self._error_state = True
|
self._error_state = True
|
||||||
return
|
return
|
||||||
|
|
||||||
if data is None:
|
|
||||||
self._error_state = True
|
|
||||||
return
|
|
||||||
|
|
||||||
# Verify that the frontend is loaded
|
# Verify that the frontend is loaded
|
||||||
if "frontend" not in data.get("components", []):
|
if "frontend" not in data.get("components", []):
|
||||||
_LOGGER.error("API responds but frontend is not loaded")
|
_LOGGER.error("API responds but frontend is not loaded")
|
||||||
|
|||||||
Reference in New Issue
Block a user