diff --git a/custom_components/hacs/repositories/base.py b/custom_components/hacs/repositories/base.py index 43fa1967501..0464dd8a8e6 100644 --- a/custom_components/hacs/repositories/base.py +++ b/custom_components/hacs/repositories/base.py @@ -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 @@ -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, + ), response.etag + except GitHubNotModifiedException as exception: raise HacsNotModifiedException(exception) from exception - except (ValueError, AIOGitHubAPIException, Exception) as exception: + except Exception as exception: raise HacsException(exception) from exception def update_filenames(self) -> None: