Fix hassio panel load (#32922)

* Fix loading hassio panel

* Remove blacklist
This commit is contained in:
Paulus Schoutsen 2020-03-17 17:54:57 -07:00
parent 8348878e7e
commit d0d9d853f2
3 changed files with 9 additions and 31 deletions

View File

@ -190,16 +190,15 @@ async def async_setup(hass, config):
hass.http.register_view(HassIOView(host, websession)) hass.http.register_view(HassIOView(host, websession))
if "frontend" in hass.config.components: await hass.components.panel_custom.async_register_panel(
await hass.components.panel_custom.async_register_panel( frontend_url_path="hassio",
frontend_url_path="hassio", webcomponent_name="hassio-main",
webcomponent_name="hassio-main", sidebar_title="Supervisor",
sidebar_title="Supervisor", sidebar_icon="hass:home-assistant",
sidebar_icon="hass:home-assistant", js_url="/api/hassio/app/entrypoint.js",
js_url="/api/hassio/app/entrypoint.js", embed_iframe=True,
embed_iframe=True, require_admin=True,
require_admin=True, )
)
await hassio.update_hass_api(config.get("http", {}), refresh_token) await hassio.update_hass_api(config.get("http", {}), refresh_token)

View File

@ -19,8 +19,6 @@ DATA_DEPS_REQS = "deps_reqs_processed"
SLOW_SETUP_WARNING = 10 SLOW_SETUP_WARNING = 10
BLACKLIST = set(["auto_backup"])
def setup_component(hass: core.HomeAssistant, domain: str, config: Dict) -> bool: def setup_component(hass: core.HomeAssistant, domain: str, config: Dict) -> bool:
"""Set up a component and all its dependencies.""" """Set up a component and all its dependencies."""
@ -39,12 +37,6 @@ async def async_setup_component(
if domain in hass.config.components: if domain in hass.config.components:
return True return True
if domain in BLACKLIST:
_LOGGER.error(
"Integration %s is blacklisted because it is causing issues.", domain
)
return False
setup_tasks = hass.data.setdefault(DATA_SETUP, {}) setup_tasks = hass.data.setdefault(DATA_SETUP, {})
if domain in setup_tasks: if domain in setup_tasks:

View File

@ -6,7 +6,6 @@ import os
import threading import threading
from unittest import mock from unittest import mock
from asynctest import patch
import voluptuous as vol import voluptuous as vol
from homeassistant import setup from homeassistant import setup
@ -536,15 +535,3 @@ async def test_setup_import_blows_up(hass):
"homeassistant.loader.Integration.get_component", side_effect=ValueError "homeassistant.loader.Integration.get_component", side_effect=ValueError
): ):
assert not await setup.async_setup_component(hass, "sun", {}) assert not await setup.async_setup_component(hass, "sun", {})
async def test_blacklist(caplog):
"""Test setup blacklist."""
with patch("homeassistant.setup.BLACKLIST", {"bad_integration"}):
assert not await setup.async_setup_component(
mock.Mock(config=mock.Mock(components=[])), "bad_integration", {}
)
assert (
"Integration bad_integration is blacklisted because it is causing issues."
in caplog.text
)