From 098a006f32df60cca904fcc2753aeb5a94958857 Mon Sep 17 00:00:00 2001 From: Andre Lengwenus Date: Sat, 24 Aug 2024 06:56:48 +0200 Subject: [PATCH] Bump lcn-frontend to 0.1.6 (#124490) --- homeassistant/components/lcn/manifest.json | 4 +++- homeassistant/components/lcn/websocket.py | 27 ++++++++-------------- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 4 files changed, 14 insertions(+), 21 deletions(-) diff --git a/homeassistant/components/lcn/manifest.json b/homeassistant/components/lcn/manifest.json index 44aae34e9e6..f8b7d02b103 100644 --- a/homeassistant/components/lcn/manifest.json +++ b/homeassistant/components/lcn/manifest.json @@ -1,10 +1,12 @@ { "domain": "lcn", "name": "LCN", + "after_dependencies": ["panel_custom"], "codeowners": ["@alengwenus"], "config_flow": true, + "dependencies": ["http", "websocket_api"], "documentation": "https://www.home-assistant.io/integrations/lcn", "iot_class": "local_push", "loggers": ["pypck"], - "requirements": ["pypck==0.7.21", "lcn-frontend==0.1.5"] + "requirements": ["pypck==0.7.21", "lcn-frontend==0.1.6"] } diff --git a/homeassistant/components/lcn/websocket.py b/homeassistant/components/lcn/websocket.py index 5317bc86763..6fda20aba93 100644 --- a/homeassistant/components/lcn/websocket.py +++ b/homeassistant/components/lcn/websocket.py @@ -10,6 +10,7 @@ import lcn_frontend as lcn_panel import voluptuous as vol from homeassistant.components import panel_custom, websocket_api +from homeassistant.components.http import StaticPathConfig from homeassistant.components.websocket_api import AsyncWebSocketCommandHandler from homeassistant.config_entries import ConfigEntry from homeassistant.const import ( @@ -17,7 +18,6 @@ from homeassistant.const import ( CONF_DEVICES, CONF_DOMAIN, CONF_ENTITIES, - CONF_ENTITY_ID, CONF_NAME, CONF_RESOURCE, ) @@ -77,10 +77,14 @@ async def register_panel_and_ws_api(hass: HomeAssistant) -> None: websocket_api.async_register_command(hass, websocket_delete_entity) if DOMAIN not in hass.data.get("frontend_panels", {}): - hass.http.register_static_path( - URL_BASE, - path=lcn_panel.locate_dir(), - cache_headers=lcn_panel.is_prod_build, + await hass.http.async_register_static_paths( + [ + StaticPathConfig( + URL_BASE, + path=lcn_panel.locate_dir(), + cache_headers=lcn_panel.is_prod_build, + ) + ] ) await panel_custom.async_register_panel( hass=hass, @@ -154,19 +158,6 @@ async def websocket_get_entity_configs( else: entity_configs = config_entry.data[CONF_ENTITIES] - entity_registry = er.async_get(hass) - for entity_config in entity_configs: - entity_unique_id = generate_unique_id( - config_entry.entry_id, - entity_config[CONF_ADDRESS], - entity_config[CONF_RESOURCE], - ) - entity_id = entity_registry.async_get_entity_id( - entity_config[CONF_DOMAIN], DOMAIN, entity_unique_id - ) - - entity_config[CONF_ENTITY_ID] = entity_id - connection.send_result(msg["id"], entity_configs) diff --git a/requirements_all.txt b/requirements_all.txt index eb3abd3abf0..1d177fadeb0 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1243,7 +1243,7 @@ lakeside==0.13 laundrify-aio==1.2.2 # homeassistant.components.lcn -lcn-frontend==0.1.5 +lcn-frontend==0.1.6 # homeassistant.components.ld2410_ble ld2410-ble==0.1.1 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index ce1daaec451..1fee30e8e47 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -1036,7 +1036,7 @@ lacrosse-view==1.0.2 laundrify-aio==1.2.2 # homeassistant.components.lcn -lcn-frontend==0.1.5 +lcn-frontend==0.1.6 # homeassistant.components.ld2410_ble ld2410-ble==0.1.1