Skip to content

Commit

Permalink
No etag for default files (#2208)
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeeus committed Sep 3, 2021
1 parent f13901d commit b4ae25f
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 10 deletions.
6 changes: 1 addition & 5 deletions custom_components/hacs/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ class HacsSystem:
class HacsBase:
"""Base HACS class."""

_etag_hacs_default = {}
_repositories = []
_repositories_by_full_name = {}
_repositories_by_id = {}
Expand Down Expand Up @@ -230,9 +229,6 @@ async def async_can_update(self) -> int:
async def async_github_get_hacs_default_file(self, filename: str) -> dict[str, Any]:
"""Get the content of a default file."""
response = await self.githubapi.repos.contents.get(
repository=REPOSITORY_HACS_DEFAULT,
path=filename,
**{"etag": self._etag_hacs_default.get(filename)},
repository=REPOSITORY_HACS_DEFAULT, path=filename
)
self._etag_hacs_default[filename] = response.etag
return json.loads(decode_content(response.data.content))
4 changes: 0 additions & 4 deletions custom_components/hacs/hacsbase/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ async def async_write(self):
"onboarding_done": self.hacs.configuration.onboarding_done,
"archived_repositories": self.hacs.common.archived_repositories,
"renamed_repositories": self.hacs.common.renamed_repositories,
"etag_hacs_default": self.hacs._etag_hacs_default, # pylint: disable=protected-access
},
)
await self._async_store_content_and_repos()
Expand Down Expand Up @@ -134,9 +133,6 @@ async def restore(self):
self.hacs.configuration.onboarding_done = hacs.get("onboarding_done", False)
self.hacs.common.archived_repositories = hacs.get("archived_repositories", [])
self.hacs.common.renamed_repositories = hacs.get("renamed_repositories", {})
self.hacs._etag_hacs_default = hacs.get( # pylint: disable=protected-access
"etag_hacs_default", {}
)

# Repositories
hass = self.hacs.hass
Expand Down
1 change: 0 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ def exc_handle(loop, context):
def hacs(hass):
"""Fixture to provide a HACS object."""
hacs_obj = Hacs()
hacs_obj._etag_hacs_default = {}
hacs_obj._repositories = []
hacs_obj._repositories_by_full_name = {}
hacs_obj._repositories_by_id = {}
Expand Down

0 comments on commit b4ae25f

Please sign in to comment.