mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-16 05:36:29 +00:00
Fix Home Assistant Core API check (#4663)
* Fix Home Assistant Core API check * Remove check_api_state mock to improve test coverage
This commit is contained in:
parent
6762a4153a
commit
6f01341055
@ -164,6 +164,6 @@ class HomeAssistantAPI(CoreSysAttributes):
|
||||
|
||||
async def check_api_state(self) -> bool:
|
||||
"""Return Home Assistant Core state if up."""
|
||||
if state := self.get_api_state():
|
||||
if state := await self.get_api_state():
|
||||
return state == "RUNNING"
|
||||
return False
|
||||
|
@ -353,7 +353,6 @@ async def coresys(
|
||||
)
|
||||
|
||||
# WebSocket
|
||||
coresys_obj.homeassistant.api.check_api_state = AsyncMock(return_value=True)
|
||||
coresys_obj.homeassistant.api.get_api_state = AsyncMock(return_value="RUNNING")
|
||||
coresys_obj.homeassistant._websocket._client = AsyncMock(
|
||||
ha_version=AwesomeVersion("2021.2.4")
|
||||
|
Loading…
x
Reference in New Issue
Block a user