Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions custom_components/hacs/repositories/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

from aiogithubapi import (
AIOGitHubAPIException,
AIOGitHubAPINotModifiedException,
GitHubException,
GitHubNotModifiedException,
)
import attr
from homeassistant.helpers import device_registry as dr, issue_registry as ir
Expand Down Expand Up @@ -1012,11 +1012,17 @@ async def async_get_legacy_repository_object(
) -> tuple[AIOGitHubAPIRepository, Any | None]:
"""Return a repository object."""
try:
repository = await self.hacs.github.get_repo(self.data.full_name, etag)
return repository, self.hacs.github.client.last_response.etag
except AIOGitHubAPINotModifiedException as exception:
response = await self.hacs.githubapi.repos.get(
repository=self.data.full_name,
etag=etag,
)
return AIOGitHubAPIRepository(
client=self.hacs.github.client,
attributes=response.data._raw_data,
Comment thread
ludeeus marked this conversation as resolved.
), response.etag
except GitHubNotModifiedException as exception:
raise HacsNotModifiedException(exception) from exception
except (ValueError, AIOGitHubAPIException, Exception) as exception:
except Exception as exception:
Comment thread
ludeeus marked this conversation as resolved.
raise HacsException(exception) from exception

def update_filenames(self) -> None:
Expand Down