From 5cf8e6d40f9f60351ba9796fb19818adadda0642 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Bachmann?= Date: Thu, 15 Jan 2026 11:18:17 +0000 Subject: [PATCH] custom_components/bahmcloud_store/providers.py aktualisiert --- custom_components/bahmcloud_store/providers.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/custom_components/bahmcloud_store/providers.py b/custom_components/bahmcloud_store/providers.py index 68ab5d4..cd56c95 100644 --- a/custom_components/bahmcloud_store/providers.py +++ b/custom_components/bahmcloud_store/providers.py @@ -9,7 +9,7 @@ from homeassistant.helpers.aiohttp_client import async_get_clientsession _LOGGER = logging.getLogger(__name__) -UA = "BahmcloudStore/0.4.0 (Home Assistant)" +UA = "BahmcloudStore (Home Assistant)" @dataclass @@ -72,12 +72,14 @@ async def _github_latest_version(hass: HomeAssistant, owner: str, repo: str) -> "User-Agent": UA, } + # 1) Releases latest data, _ = await _safe_json(session, f"https://api.github.com/repos/{owner}/{repo}/releases/latest", headers=headers) if isinstance(data, dict): tag = data.get("tag_name") or data.get("name") if isinstance(tag, str) and tag.strip(): return tag.strip(), "release" + # 2) Fallback: newest tag data, _ = await _safe_json(session, f"https://api.github.com/repos/{owner}/{repo}/tags?per_page=1", headers=headers) if isinstance(data, list) and data: tag = data[0].get("name") @@ -130,6 +132,7 @@ async def fetch_repo_info(hass: HomeAssistant, repo_url: str) -> RepoInfo: "Accept": "application/vnd.github+json", "User-Agent": UA, } + data, _ = await _safe_json(session, f"https://api.github.com/repos/{owner}/{repo}", headers=headers) if isinstance(data, dict): info.description = data.get("description")