Skip to content

Commit

Permalink
Implement entity_picture for update entities (#2594)
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeeus authored Apr 3, 2022
1 parent 645c396 commit 632b1d5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions custom_components/hacs/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,17 @@ def release_summary(self) -> str | None:
return "<ha-alert alert-type='error'>Restart of Home Assistant required</ha-alert>"
return None

@property
def entity_picture(self) -> str | None:
"""Return the entity picture to use in the frontend."""
if (
self.repository.data.category != HacsCategory.INTEGRATION
or self.repository.data.domain is None
):
return None

return f"https://brands.home-assistant.io/_/{self.repository.data.domain}/icon.png"

async def async_install(self, version: str | None, backup: bool, **kwargs: Any) -> None:
"""Install an update."""
if self.repository.display_version_or_commit == "version":
Expand Down

0 comments on commit 632b1d5

Please sign in to comment.