Set brand icon on WLED update entity (#69145)

This commit is contained in:
Franck Nijhof 2022-04-02 21:28:08 +02:00 committed by GitHub
parent 1103c5d101
commit 1a04dc4fca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View File

@ -50,6 +50,11 @@ class WLEDUpdateEntity(WLEDEntity, UpdateEntity):
return None
return str(version)
@property
def entity_picture(self) -> str:
"""Return the entity picture to use in the frontend, if any."""
return "https://brands.home-assistant.io/wled/icon.png"
@property
def latest_version(self) -> str | None:
"""Latest version available for install."""

View File

@ -20,6 +20,7 @@ from homeassistant.components.update.const import (
from homeassistant.const import (
ATTR_DEVICE_CLASS,
ATTR_ENTITY_ID,
ATTR_ENTITY_PICTURE,
ATTR_ICON,
ATTR_SUPPORTED_FEATURES,
STATE_OFF,
@ -46,6 +47,10 @@ async def test_update_available(
assert state
assert state.attributes.get(ATTR_DEVICE_CLASS) == UpdateDeviceClass.FIRMWARE
assert state.state == STATE_ON
assert (
state.attributes[ATTR_ENTITY_PICTURE]
== "https://brands.home-assistant.io/wled/icon.png"
)
assert state.attributes[ATTR_INSTALLED_VERSION] == "0.8.5"
assert state.attributes[ATTR_LATEST_VERSION] == "0.12.0"
assert state.attributes[ATTR_RELEASE_SUMMARY] is None