Skip to content

Commit

Permalink
Fix update entity missing after installing HACS (#3840)
Browse files Browse the repository at this point in the history
Co-authored-by: Joakim Sørensen <[email protected]>
  • Loading branch information
emontnemery and ludeeus authored Jul 4, 2024
1 parent 42151d9 commit cf6c3b4
Show file tree
Hide file tree
Showing 26 changed files with 780 additions and 25 deletions.
5 changes: 5 additions & 0 deletions custom_components/hacs/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,9 @@ async def async_load_hacs_from_github(self, _=None) -> None:

try:
repository = self.repositories.get_by_full_name(HacsGitHubRepo.INTEGRATION)
should_recreate_entities = False
if repository is None:
should_recreate_entities = True
await self.async_register_repository(
repository_full_name=HacsGitHubRepo.INTEGRATION,
category=HacsCategory.INTEGRATION,
Expand All @@ -818,6 +820,9 @@ async def async_load_hacs_from_github(self, _=None) -> None:
repository.data.new = False
repository.data.releases = True

if should_recreate_entities:
await self.async_recreate_entities()

self.repository = repository.repository_object
self.repositories.mark_default(repository)
except HacsException as exception:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,37 @@
}
},
"_directory": [],
"_entities": [],
"_entities": [
{
"area_id": null,
"attributes": {
"auto_update": false,
"entity_picture": "https://brands.home-assistant.io/_/hacs/icon.png",
"friendly_name": "HACS update",
"in_progress": false,
"installed_version": "0.0.0",
"latest_version": "",
"release_summary": null,
"release_url": "https://github.com/hacs/integration/releases/",
"skipped_version": null,
"supported_features": 23,
"title": null
},
"disabled_by": null,
"entity_category": "config",
"entity_id": "update.hacs_update",
"has_entity_name": false,
"hidden_by": null,
"icon": null,
"name": null,
"options": {},
"original_name": "HACS update",
"platform": "hacs",
"state": "on",
"translation_key": null,
"unique_id": "172733314"
}
],
"_hacs": {
"configuration": {
"debug": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,37 @@
}
},
"_directory": [],
"_entities": [],
"_entities": [
{
"area_id": null,
"attributes": {
"auto_update": false,
"entity_picture": "https://brands.home-assistant.io/_/hacs/icon.png",
"friendly_name": "HACS update",
"in_progress": false,
"installed_version": "0.0.0",
"latest_version": "",
"release_summary": null,
"release_url": "https://github.com/hacs/integration/releases/",
"skipped_version": null,
"supported_features": 23,
"title": null
},
"disabled_by": null,
"entity_category": "config",
"entity_id": "update.hacs_update",
"has_entity_name": false,
"hidden_by": null,
"icon": null,
"name": null,
"options": {},
"original_name": "HACS update",
"platform": "hacs",
"state": "on",
"translation_key": null,
"unique_id": "172733314"
}
],
"_hacs": {
"configuration": {
"debug": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,37 @@
"/config/appdaemon/apps/appdaemon-basic/__init__.py",
"/config/appdaemon/apps/appdaemon-basic/example.py"
],
"_entities": [],
"_entities": [
{
"area_id": null,
"attributes": {
"auto_update": false,
"entity_picture": "https://brands.home-assistant.io/_/hacs/icon.png",
"friendly_name": "HACS update",
"in_progress": false,
"installed_version": "0.0.0",
"latest_version": "",
"release_summary": null,
"release_url": "https://github.com/hacs/integration/releases/",
"skipped_version": null,
"supported_features": 23,
"title": null
},
"disabled_by": null,
"entity_category": "config",
"entity_id": "update.hacs_update",
"has_entity_name": false,
"hidden_by": null,
"icon": null,
"name": null,
"options": {},
"original_name": "HACS update",
"platform": "hacs",
"state": "on",
"translation_key": null,
"unique_id": "172733314"
}
],
"_hacs": {
"configuration": {
"debug": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,37 @@
"_directory": [
"/config/appdaemon/apps/appdaemon-basic/__init__.py"
],
"_entities": [],
"_entities": [
{
"area_id": null,
"attributes": {
"auto_update": false,
"entity_picture": "https://brands.home-assistant.io/_/hacs/icon.png",
"friendly_name": "HACS update",
"in_progress": false,
"installed_version": "0.0.0",
"latest_version": "",
"release_summary": null,
"release_url": "https://github.com/hacs/integration/releases/",
"skipped_version": null,
"supported_features": 23,
"title": null
},
"disabled_by": null,
"entity_category": "config",
"entity_id": "update.hacs_update",
"has_entity_name": false,
"hidden_by": null,
"icon": null,
"name": null,
"options": {},
"original_name": "HACS update",
"platform": "hacs",
"state": "on",
"translation_key": null,
"unique_id": "172733314"
}
],
"_hacs": {
"configuration": {
"debug": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,37 @@
}
},
"_directory": [],
"_entities": [],
"_entities": [
{
"area_id": null,
"attributes": {
"auto_update": false,
"entity_picture": "https://brands.home-assistant.io/_/hacs/icon.png",
"friendly_name": "HACS update",
"in_progress": false,
"installed_version": "0.0.0",
"latest_version": "",
"release_summary": null,
"release_url": "https://github.com/hacs/integration/releases/",
"skipped_version": null,
"supported_features": 23,
"title": null
},
"disabled_by": null,
"entity_category": "config",
"entity_id": "update.hacs_update",
"has_entity_name": false,
"hidden_by": null,
"icon": null,
"name": null,
"options": {},
"original_name": "HACS update",
"platform": "hacs",
"state": "on",
"translation_key": null,
"unique_id": "172733314"
}
],
"_hacs": {
"configuration": {
"debug": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,37 @@
}
},
"_directory": [],
"_entities": [],
"_entities": [
{
"area_id": null,
"attributes": {
"auto_update": false,
"entity_picture": "https://brands.home-assistant.io/_/hacs/icon.png",
"friendly_name": "HACS update",
"in_progress": false,
"installed_version": "0.0.0",
"latest_version": "",
"release_summary": null,
"release_url": "https://github.com/hacs/integration/releases/",
"skipped_version": null,
"supported_features": 23,
"title": null
},
"disabled_by": null,
"entity_category": "config",
"entity_id": "update.hacs_update",
"has_entity_name": false,
"hidden_by": null,
"icon": null,
"name": null,
"options": {},
"original_name": "HACS update",
"platform": "hacs",
"state": "on",
"translation_key": null,
"unique_id": "172733314"
}
],
"_hacs": {
"configuration": {
"debug": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,37 @@
"/config/custom_components/example/manifest.json",
"/config/custom_components/example/module/__init__.py"
],
"_entities": [],
"_entities": [
{
"area_id": null,
"attributes": {
"auto_update": false,
"entity_picture": "https://brands.home-assistant.io/_/hacs/icon.png",
"friendly_name": "HACS update",
"in_progress": false,
"installed_version": "0.0.0",
"latest_version": "",
"release_summary": null,
"release_url": "https://github.com/hacs/integration/releases/",
"skipped_version": null,
"supported_features": 23,
"title": null
},
"disabled_by": null,
"entity_category": "config",
"entity_id": "update.hacs_update",
"has_entity_name": false,
"hidden_by": null,
"icon": null,
"name": null,
"options": {},
"original_name": "HACS update",
"platform": "hacs",
"state": "on",
"translation_key": null,
"unique_id": "172733314"
}
],
"_hacs": {
"configuration": {
"debug": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,37 @@
"/config/custom_components/example/__init__.py",
"/config/custom_components/example/manifest.json"
],
"_entities": [],
"_entities": [
{
"area_id": null,
"attributes": {
"auto_update": false,
"entity_picture": "https://brands.home-assistant.io/_/hacs/icon.png",
"friendly_name": "HACS update",
"in_progress": false,
"installed_version": "0.0.0",
"latest_version": "",
"release_summary": null,
"release_url": "https://github.com/hacs/integration/releases/",
"skipped_version": null,
"supported_features": 23,
"title": null
},
"disabled_by": null,
"entity_category": "config",
"entity_id": "update.hacs_update",
"has_entity_name": false,
"hidden_by": null,
"icon": null,
"name": null,
"options": {},
"original_name": "HACS update",
"platform": "hacs",
"state": "on",
"translation_key": null,
"unique_id": "172733314"
}
],
"_hacs": {
"configuration": {
"debug": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,37 @@
}
},
"_directory": [],
"_entities": [],
"_entities": [
{
"area_id": null,
"attributes": {
"auto_update": false,
"entity_picture": "https://brands.home-assistant.io/_/hacs/icon.png",
"friendly_name": "HACS update",
"in_progress": false,
"installed_version": "0.0.0",
"latest_version": "",
"release_summary": null,
"release_url": "https://github.com/hacs/integration/releases/",
"skipped_version": null,
"supported_features": 23,
"title": null
},
"disabled_by": null,
"entity_category": "config",
"entity_id": "update.hacs_update",
"has_entity_name": false,
"hidden_by": null,
"icon": null,
"name": null,
"options": {},
"original_name": "HACS update",
"platform": "hacs",
"state": "on",
"translation_key": null,
"unique_id": "172733314"
}
],
"_hacs": {
"configuration": {
"debug": false,
Expand Down
Loading

0 comments on commit cf6c3b4

Please sign in to comment.