Import panel_custom (#64541)

Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
epenet 2022-01-20 13:06:44 +01:00 committed by GitHub
parent bb671830a6
commit dbc6e41264
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -10,7 +10,7 @@ from typing import Any, NamedTuple
import voluptuous as vol
from homeassistant.auth.const import GROUP_ID_ADMIN
from homeassistant.components import persistent_notification
from homeassistant.components import panel_custom, persistent_notification
from homeassistant.components.homeassistant import (
SERVICE_CHECK_CONFIG,
SHUTDOWN_SERVICES,
@ -467,7 +467,8 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: # noqa:
hass.http.register_view(HassIOView(host, websession))
await hass.components.panel_custom.async_register_panel(
await panel_custom.async_register_panel(
hass,
frontend_url_path="hassio",
webcomponent_name="hassio-main",
js_url="/api/hassio/app/entrypoint.js",

View File

@ -5,7 +5,7 @@ import logging
from aiohttp import web
from homeassistant.components import frontend
from homeassistant.components import frontend, panel_custom
from homeassistant.components.http import HomeAssistantView
from homeassistant.const import ATTR_ICON
from homeassistant.core import HomeAssistant
@ -78,7 +78,8 @@ class HassIOAddonPanel(HomeAssistantView):
async def _register_panel(hass, addon, data):
"""Init coroutine to register the panel."""
await hass.components.panel_custom.async_register_panel(
await panel_custom.async_register_panel(
hass,
frontend_url_path=addon,
webcomponent_name="hassio-main",
sidebar_title=data[ATTR_TITLE],