From 82fda5dfc49d692bbc89bc0d7db463a96812de17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Bachmann?= Date: Thu, 15 Jan 2026 15:39:10 +0000 Subject: [PATCH] custom_components/bahmcloud_store/core.py aktualisiert --- custom_components/bahmcloud_store/core.py | 31 +---------------------- 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/custom_components/bahmcloud_store/core.py b/custom_components/bahmcloud_store/core.py index d0e18f4..04f4b5a 100644 --- a/custom_components/bahmcloud_store/core.py +++ b/custom_components/bahmcloud_store/core.py @@ -46,7 +46,7 @@ class RepoItem: default_branch: str | None = None latest_version: str | None = None - latest_version_source: str | None = None # "release" | "tag" | None + latest_version_source: str | None = None # "release" | "tag" | "atom" | None meta_source: str | None = None meta_name: str | None = None @@ -239,35 +239,6 @@ class BCSCore: ) return out - def _split_owner_repo(self, repo_url: str) -> tuple[str | None, str | None]: - u = urlparse(repo_url.rstrip("/")) - parts = [p for p in u.path.strip("/").split("/") if p] - if len(parts) < 2: - return None, None - owner = parts[0].strip() or None - name = parts[1].strip() - if name.endswith(".git"): - name = name[:-4] - name = name.strip() or None - return owner, name - - def _is_github(self, repo_url: str) -> bool: - return "github.com" in urlparse(repo_url).netloc.lower() - - def _is_gitea(self, repo_url: str) -> bool: - host = urlparse(repo_url).netloc.lower() - return host and "github.com" not in host and "gitlab.com" not in host - - async def _fetch_text(self, url: str) -> str | None: - session = async_get_clientsession(self.hass) - try: - async with session.get(url, timeout=20) as resp: - if resp.status != 200: - return None - return await resp.text() - except Exception: - return None - async def fetch_readme_markdown(self, repo_id: str) -> str | None: repo = self.get_repo(repo_id) if not repo: