diff --git a/homeassistant/components/homeassistant_hardware/update.py b/homeassistant/components/homeassistant_hardware/update.py index 960facc81f8..1b0f15ca021 100644 --- a/homeassistant/components/homeassistant_hardware/update.py +++ b/homeassistant/components/homeassistant_hardware/update.py @@ -95,8 +95,7 @@ class BaseFirmwareUpdateEntity( _attr_supported_features = ( UpdateEntityFeature.INSTALL | UpdateEntityFeature.PROGRESS ) - # Until this entity can be associated with a device, we must manually name it - _attr_has_entity_name = False + _attr_has_entity_name = True def __init__( self, @@ -195,10 +194,6 @@ class BaseFirmwareUpdateEntity( def _update_attributes(self) -> None: """Recompute the attributes of the entity.""" - - # This entity is not currently associated with a device so we must manually - # give it a name - self._attr_name = f"{self._config_entry.title} Update" self._attr_title = self.entity_description.firmware_name or "Unknown" if ( diff --git a/homeassistant/components/homeassistant_sky_connect/update.py b/homeassistant/components/homeassistant_sky_connect/update.py index 5eaa1e220be..74c28b37eaf 100644 --- a/homeassistant/components/homeassistant_sky_connect/update.py +++ b/homeassistant/components/homeassistant_sky_connect/update.py @@ -168,7 +168,6 @@ class FirmwareUpdateEntity(BaseFirmwareUpdateEntity): """SkyConnect firmware update entity.""" bootloader_reset_type = None - _attr_has_entity_name = True def __init__( self, diff --git a/homeassistant/components/homeassistant_yellow/strings.json b/homeassistant/components/homeassistant_yellow/strings.json index ddff5fd9b6d..41c1438b234 100644 --- a/homeassistant/components/homeassistant_yellow/strings.json +++ b/homeassistant/components/homeassistant_yellow/strings.json @@ -152,7 +152,7 @@ }, "entity": { "update": { - "firmware": { + "radio_firmware": { "name": "Radio firmware" } } diff --git a/homeassistant/components/homeassistant_yellow/update.py b/homeassistant/components/homeassistant_yellow/update.py index 94989d5c6b6..9531bd456cb 100644 --- a/homeassistant/components/homeassistant_yellow/update.py +++ b/homeassistant/components/homeassistant_yellow/update.py @@ -44,6 +44,7 @@ FIRMWARE_ENTITY_DESCRIPTIONS: dict[ ] = { ApplicationType.EZSP: FirmwareUpdateEntityDescription( key="radio_firmware", + translation_key="radio_firmware", display_precision=0, device_class=UpdateDeviceClass.FIRMWARE, entity_category=EntityCategory.CONFIG, @@ -55,6 +56,7 @@ FIRMWARE_ENTITY_DESCRIPTIONS: dict[ ), ApplicationType.SPINEL: FirmwareUpdateEntityDescription( key="radio_firmware", + translation_key="radio_firmware", display_precision=0, device_class=UpdateDeviceClass.FIRMWARE, entity_category=EntityCategory.CONFIG, @@ -65,7 +67,8 @@ FIRMWARE_ENTITY_DESCRIPTIONS: dict[ firmware_name="OpenThread RCP", ), ApplicationType.CPC: FirmwareUpdateEntityDescription( - key="firmware", + key="radio_firmware", + translation_key="radio_firmware", display_precision=0, device_class=UpdateDeviceClass.FIRMWARE, entity_category=EntityCategory.CONFIG, @@ -76,7 +79,8 @@ FIRMWARE_ENTITY_DESCRIPTIONS: dict[ firmware_name="Multiprotocol", ), ApplicationType.GECKO_BOOTLOADER: FirmwareUpdateEntityDescription( - key="firmware", + key="radio_firmware", + translation_key="radio_firmware", display_precision=0, device_class=UpdateDeviceClass.FIRMWARE, entity_category=EntityCategory.CONFIG, @@ -88,6 +92,7 @@ FIRMWARE_ENTITY_DESCRIPTIONS: dict[ ), None: FirmwareUpdateEntityDescription( key="radio_firmware", + translation_key="radio_firmware", display_precision=0, device_class=UpdateDeviceClass.FIRMWARE, entity_category=EntityCategory.CONFIG, @@ -168,7 +173,6 @@ class FirmwareUpdateEntity(BaseFirmwareUpdateEntity): """Yellow firmware update entity.""" bootloader_reset_type = "yellow" # Triggers a GPIO reset - _attr_has_entity_name = True def __init__( self, diff --git a/tests/components/homeassistant_hardware/test_update.py b/tests/components/homeassistant_hardware/test_update.py index 0c351141e12..23d1e546791 100644 --- a/tests/components/homeassistant_hardware/test_update.py +++ b/tests/components/homeassistant_hardware/test_update.py @@ -43,6 +43,7 @@ from homeassistant.core import ( ) from homeassistant.helpers import entity_registry as er from homeassistant.helpers.aiohttp_client import async_get_clientsession +from homeassistant.helpers.device_registry import DeviceInfo from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback from homeassistant.setup import async_setup_component from homeassistant.util import dt as dt_util @@ -61,7 +62,7 @@ from tests.common import ( TEST_DOMAIN = "test" TEST_DEVICE = "/dev/serial/by-id/some-unique-serial-device-12345" TEST_FIRMWARE_RELEASES_URL = "https://example.org/firmware" -TEST_UPDATE_ENTITY_ID = "update.test_firmware" +TEST_UPDATE_ENTITY_ID = "update.mock_name_firmware" TEST_MANIFEST = FirmwareManifest( url=URL("https://example.org/firmware"), html_url=URL("https://example.org/release_notes"), @@ -205,6 +206,12 @@ class MockFirmwareUpdateEntity(BaseFirmwareUpdateEntity): """Initialize the mock SkyConnect firmware update entity.""" super().__init__(device, config_entry, update_coordinator, entity_description) self._attr_unique_id = self.entity_description.key + self._attr_device_info = DeviceInfo( + identifiers={(TEST_DOMAIN, "yellow")}, + name="Mock Name", + model="Mock Model", + manufacturer="Mock Manufacturer", + ) # Use the cached firmware info if it exists if self._config_entry.data["firmware"] is not None: diff --git a/tests/components/homeassistant_yellow/test_update.py b/tests/components/homeassistant_yellow/test_update.py index 2cc7b51836c..66404dc2176 100644 --- a/tests/components/homeassistant_yellow/test_update.py +++ b/tests/components/homeassistant_yellow/test_update.py @@ -17,7 +17,7 @@ from homeassistant.setup import async_setup_component from tests.common import MockConfigEntry -UPDATE_ENTITY_ID = "update.home_assistant_yellow_firmware" +UPDATE_ENTITY_ID = "update.home_assistant_yellow_radio_firmware" async def test_yellow_update_entity(hass: HomeAssistant) -> None: