Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable hass.io panel without ping #22388

Merged
merged 2 commits into from Mar 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions homeassistant/components/hassio/__init__.py
Expand Up @@ -145,8 +145,7 @@ async def async_setup(hass, config):
hass.data[DOMAIN] = hassio = HassIO(hass.loop, websession, host)

if not await hassio.is_connected():
_LOGGER.error("Not connected with Hass.io")
return False
_LOGGER.warning("Not connected with Hass.io / system to busy!")

store = hass.helpers.storage.Store(STORAGE_VERSION, STORAGE_KEY)
data = await store.async_load()
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/hassio/handler.py
Expand Up @@ -62,7 +62,7 @@ def is_connected(self):

This method return a coroutine.
"""
return self.send_command("/supervisor/ping", method="get")
return self.send_command("/supervisor/ping", method="get", timeout=15)

@_api_data
def get_homeassistant_info(self):
Expand Down
7 changes: 4 additions & 3 deletions tests/components/hassio/test_init.py
Expand Up @@ -196,15 +196,16 @@ def test_fail_setup_without_environ_var(hass):


@asyncio.coroutine
def test_fail_setup_cannot_connect(hass):
def test_fail_setup_cannot_connect(hass, caplog):
"""Fail setup if cannot connect."""
with patch.dict(os.environ, MOCK_ENVIRON), \
patch('homeassistant.components.hassio.HassIO.is_connected',
Mock(return_value=mock_coro(None))):
result = yield from async_setup_component(hass, 'hassio', {})
assert not result
assert result

assert not hass.components.hassio.is_hassio()
assert hass.components.hassio.is_hassio()
assert "Not connected with Hass.io / system to busy!" in caplog.text


@asyncio.coroutine
Expand Down