1
0
mirror of https://github.com/home-assistant/core.git synced 2026-02-15 07:36:16 +00:00

Add app panel (#157554)

Co-authored-by: Petar Petrov <MindFreeze@users.noreply.github.com>
This commit is contained in:
Paulus Schoutsen
2026-01-19 06:08:00 -05:00
committed by GitHub
parent 8c997cb6a9
commit af83fa809a
2 changed files with 23 additions and 1 deletions

View File

@@ -16,7 +16,7 @@ from aiohasupervisor.models import GreenOptions, YellowOptions # noqa: F401
import voluptuous as vol
from homeassistant.auth.const import GROUP_ID_ADMIN
from homeassistant.components import panel_custom
from homeassistant.components import frontend, panel_custom
from homeassistant.components.homeassistant import async_set_stop_handler
from homeassistant.components.http import StaticPathConfig
from homeassistant.config_entries import SOURCE_SYSTEM, ConfigEntry
@@ -292,6 +292,7 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: # noqa:
return False
async_load_websocket_api(hass)
frontend.async_register_built_in_panel(hass, "app")
host = os.environ["SUPERVISOR"]
websession = async_get_clientsession(hass)

View File

@@ -260,6 +260,27 @@ async def test_setup_api_panel(
}
async def test_setup_app_panel(hass: HomeAssistant) -> None:
"""Test app panel is registered."""
with patch.dict(os.environ, MOCK_ENVIRON):
result = await async_setup_component(hass, "hassio", {})
await hass.async_block_till_done()
assert result
panels = hass.data[frontend.DATA_PANELS]
assert panels.get("app").to_response() == {
"component_name": "app",
"icon": None,
"title": None,
"default_visible": True,
"config": None,
"url_path": "app",
"require_admin": False,
"config_panel_domain": None,
}
async def test_setup_api_push_api_data(
hass: HomeAssistant,
aioclient_mock: AiohttpClientMocker,