Skip to content

Commit

Permalink
Move "repository" dispatch message (#3426)
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeeus committed Jan 1, 2024
1 parent 87994aa commit 0cd6832
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions custom_components/hacs/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ async def async_register_repository(
repository.data.id = repository_id

else:
if self.hass is not None and ((check and repository.data.new) or self.status.new):
if self.hass is not None and check and repository.data.new:
self.async_dispatch(
HacsDispatchEvent.REPOSITORY,
{
Expand Down Expand Up @@ -887,15 +887,6 @@ async def async_get_category_repositories_experimental(self, category: str) -> N
repository.repository_manifest.update_data(
{**dict(HACS_MANIFEST_KEYS_TO_EXPORT), **manifest}
)
self.async_dispatch(
HacsDispatchEvent.REPOSITORY,
{
"id": 1337,
"action": "update",
"repository": repository.data.full_name,
"repository_id": repository.data.id,
},
)

if category == "integration":
self.status.inital_fetch_done = True
Expand All @@ -912,6 +903,16 @@ async def async_get_category_repositories_experimental(self, category: str) -> N
)
self.repositories.unregister(repository)

self.async_dispatch(
HacsDispatchEvent.REPOSITORY,
{
"id": 1337,
"action": "update",
"repository": repository.data.full_name,
"repository_id": repository.data.id,
},
)

async def async_get_category_repositories(self, category: HacsCategory) -> None:
"""Get repositories from category."""
if self.system.disabled:
Expand Down

0 comments on commit 0cd6832

Please sign in to comment.