Set brand icon as entity picture on update entities (#69200)
Co-authored-by: Joakim Sørensen <ludeeus@ludeeus.dev>
This commit is contained in:
parent
bd1d7bdbb7
commit
b644e7ed0f
5 changed files with 51 additions and 8 deletions
|
@ -208,6 +208,20 @@ class UpdateEntity(RestoreEntity):
|
|||
return EntityCategory.CONFIG
|
||||
return EntityCategory.DIAGNOSTIC
|
||||
|
||||
@property
|
||||
def entity_picture(self) -> str | None:
|
||||
"""Return the entity picture to use in the frontend.
|
||||
|
||||
Update entities return the brand icon based on the integration
|
||||
domain by default.
|
||||
"""
|
||||
if self.platform is None:
|
||||
return None
|
||||
|
||||
return (
|
||||
f"https://brands.home-assistant.io/_/{self.platform.platform_name}/icon.png"
|
||||
)
|
||||
|
||||
@property
|
||||
def in_progress(self) -> bool | int | None:
|
||||
"""Update installation progress.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue