From d332d1fd67643b6e0aaa5a20561c72047c405ca7 Mon Sep 17 00:00:00 2001 From: XiaoXianNv-boot <1446935823@qq.com> Date: Tue, 6 May 2025 01:07:28 +0000 Subject: [PATCH 1/4] Set the default upgrade icon for the MQTT device to the default icon for Home Assistant instead of the icon for the MQTT integration --- homeassistant/components/mqtt/update.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/homeassistant/components/mqtt/update.py b/homeassistant/components/mqtt/update.py index 145f0a2562c26e..5591e5d801da99 100644 --- a/homeassistant/components/mqtt/update.py +++ b/homeassistant/components/mqtt/update.py @@ -105,10 +105,7 @@ class MqttUpdate(MqttEntity, UpdateEntity, RestoreEntity): @property def entity_picture(self) -> str | None: """Return the entity picture to use in the frontend.""" - if self._attr_entity_picture is not None: - return self._attr_entity_picture - - return super().entity_picture + return self._attr_entity_picture @staticmethod def config_schema() -> VolSchemaType: From 927ef9f2b24b0aa0c7e6176fdfb1324762a2e6e6 Mon Sep 17 00:00:00 2001 From: XiaoXianNv-boot <76765956+XiaoXianNv-boot@users.noreply.github.com> Date: Tue, 6 May 2025 13:35:22 +0800 Subject: [PATCH 2/4] Set the default upgrade icon for the MQTT device to the default icon for Home Assistant instead of the icon for the MQTT integration --- tests/components/mqtt/test_update.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/components/mqtt/test_update.py b/tests/components/mqtt/test_update.py index 87eb381db03874..25369cdb545bea 100644 --- a/tests/components/mqtt/test_update.py +++ b/tests/components/mqtt/test_update.py @@ -213,7 +213,7 @@ async def test_value_template( assert state.attributes.get("latest_version") == "1.9.0" assert ( state.attributes.get("entity_picture") - == "https://brands.home-assistant.io/_/mqtt/icon.png" + == None ) async_fire_mqtt_message(hass, latest_version_topic, '{"latest":"2.0.0"}') From 7a34f2116f99f93c84226c7f442b67a0a94ede0d Mon Sep 17 00:00:00 2001 From: XiaoXianNv-boot <76765956+XiaoXianNv-boot@users.noreply.github.com> Date: Tue, 6 May 2025 13:40:36 +0800 Subject: [PATCH 3/4] Set the default upgrade icon for the MQTT device to the default icon for Home Assistant instead of the icon for the MQTT integration --- tests/components/mqtt/test_update.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/components/mqtt/test_update.py b/tests/components/mqtt/test_update.py index 25369cdb545bea..0c28083222bc86 100644 --- a/tests/components/mqtt/test_update.py +++ b/tests/components/mqtt/test_update.py @@ -211,10 +211,7 @@ async def test_value_template( assert state.state == STATE_OFF assert state.attributes.get("installed_version") == "1.9.0" assert state.attributes.get("latest_version") == "1.9.0" - assert ( - state.attributes.get("entity_picture") - == None - ) + assert state.attributes.get("entity_picture") == None async_fire_mqtt_message(hass, latest_version_topic, '{"latest":"2.0.0"}') From 01552ace2adb1ca30f1927a1bc225a1c00a3b2b4 Mon Sep 17 00:00:00 2001 From: XiaoXianNv-boot <76765956+XiaoXianNv-boot@users.noreply.github.com> Date: Tue, 6 May 2025 13:44:47 +0800 Subject: [PATCH 4/4] Set the default upgrade icon for the MQTT device to the default icon for Home Assistant instead of the icon for the MQTT integration --- tests/components/mqtt/test_update.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/components/mqtt/test_update.py b/tests/components/mqtt/test_update.py index 0c28083222bc86..2e266fb714ce0f 100644 --- a/tests/components/mqtt/test_update.py +++ b/tests/components/mqtt/test_update.py @@ -211,7 +211,7 @@ async def test_value_template( assert state.state == STATE_OFF assert state.attributes.get("installed_version") == "1.9.0" assert state.attributes.get("latest_version") == "1.9.0" - assert state.attributes.get("entity_picture") == None + assert state.attributes.get("entity_picture") is None async_fire_mqtt_message(hass, latest_version_topic, '{"latest":"2.0.0"}')