Always have addon url in detached_addon_missing (#119011)

This commit is contained in:
Mike Degatano 2024-06-07 04:52:15 -04:00 committed by Franck Nijhof
parent 5bb4e4f5d9
commit 581fb2f9f4
No known key found for this signature in database
GPG Key ID: D62583BA8AB11CA3
2 changed files with 4 additions and 5 deletions

View File

@ -267,15 +267,14 @@ class SupervisorIssues:
placeholders = {PLACEHOLDER_KEY_REFERENCE: issue.reference}
if issue.key == ISSUE_KEY_ADDON_DETACHED_ADDON_MISSING:
placeholders[PLACEHOLDER_KEY_ADDON_URL] = (
f"/hassio/addon/{issue.reference}"
)
addons = get_addons_info(self._hass)
if addons and issue.reference in addons:
placeholders[PLACEHOLDER_KEY_ADDON] = addons[issue.reference][
"name"
]
if "url" in addons[issue.reference]:
placeholders[PLACEHOLDER_KEY_ADDON_URL] = addons[
issue.reference
]["url"]
else:
placeholders[PLACEHOLDER_KEY_ADDON] = issue.reference

View File

@ -878,6 +878,6 @@ async def test_supervisor_issues_detached_addon_missing(
placeholders={
"reference": "test",
"addon": "test",
"addon_url": "https://github.com/home-assistant/addons/test",
"addon_url": "/hassio/addon/test",
},
)