From 06796cf57bb2b4ac71d03b53c31cd6e5fdba321d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Bachmann?= Date: Thu, 15 Jan 2026 14:07:15 +0000 Subject: [PATCH] =?UTF-8?q?custom=5Fcomponents/bahmcloud=5Fstore/=5F=5Fini?= =?UTF-8?q?t=5F=5F.py=20gel=C3=B6scht?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- custom_components/bahmcloud_store/__init__.py | 68 ------------------- 1 file changed, 68 deletions(-) delete mode 100644 custom_components/bahmcloud_store/__init__.py diff --git a/custom_components/bahmcloud_store/__init__.py b/custom_components/bahmcloud_store/__init__.py deleted file mode 100644 index 0237f19..0000000 --- a/custom_components/bahmcloud_store/__init__.py +++ /dev/null @@ -1,68 +0,0 @@ -from __future__ import annotations - -import logging - -from homeassistant.core import HomeAssistant -from homeassistant.components import frontend - -from .core import DOMAIN, BahmcloudStore, StoreConfig - -_LOGGER = logging.getLogger(__name__) - - -async def async_setup(hass: HomeAssistant, config: dict) -> bool: - # Read configuration from configuration.yaml: - # bahmcloud_store: - # store_url: "https://....../store.yaml" - domain_cfg = config.get(DOMAIN) or {} - - store_url = None - if isinstance(domain_cfg, dict): - store_url = domain_cfg.get("store_url") or domain_cfg.get("store") or domain_cfg.get("url") - - if not store_url or not isinstance(store_url, str): - _LOGGER.error( - "Missing configuration for %s. Please set %s: {store_url: 'https://.../store.yaml'}", - DOMAIN, - DOMAIN, - ) - return False - - store = BahmcloudStore(hass, StoreConfig(store_url=store_url)) - - # Register API + static panel assets (these are defined in core.py) - await store.register_http_views() - - # Store reference - hass.data.setdefault(DOMAIN, {}) - hass.data[DOMAIN]["store"] = store - - # Register sidebar panel (compat layer for different HA versions) - panel_js = "/api/bahmcloud_store_static/panel.js" - try: - # Some HA versions use module_url - frontend.async_register_panel( - hass, - "custom", - DOMAIN, - sidebar_title="Bahmcloud Store", - sidebar_icon="mdi:store", - module_url=panel_js, - config={}, - ) - except TypeError: - # Fallback: some HA versions use js_url instead - try: - frontend.async_register_panel( - hass, - "custom", - DOMAIN, - sidebar_title="Bahmcloud Store", - sidebar_icon="mdi:store", - js_url=panel_js, - config={}, - ) - except Exception as e: - _LOGGER.warning("Panel registration failed (store will still work via API): %s", e) - - return True