mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-16 13:46:31 +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:
|
async def check_api_state(self) -> bool:
|
||||||
"""Return Home Assistant Core state if up."""
|
"""Return Home Assistant Core state if up."""
|
||||||
if state := self.get_api_state():
|
if state := await self.get_api_state():
|
||||||
return state == "RUNNING"
|
return state == "RUNNING"
|
||||||
return False
|
return False
|
||||||
|
@ -353,7 +353,6 @@ async def coresys(
|
|||||||
)
|
)
|
||||||
|
|
||||||
# WebSocket
|
# 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.api.get_api_state = AsyncMock(return_value="RUNNING")
|
||||||
coresys_obj.homeassistant._websocket._client = AsyncMock(
|
coresys_obj.homeassistant._websocket._client = AsyncMock(
|
||||||
ha_version=AwesomeVersion("2021.2.4")
|
ha_version=AwesomeVersion("2021.2.4")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user