diff --git a/homeassistant/components/update/__init__.py b/homeassistant/components/update/__init__.py index 3fd0ee6f537..3c8a30d5b4f 100644 --- a/homeassistant/components/update/__init__.py +++ b/homeassistant/components/update/__init__.py @@ -130,7 +130,7 @@ async def async_install(entity: UpdateEntity, service_call: ServiceCall) -> None entity.installed_version == entity.latest_version or entity.latest_version is None ): - raise HomeAssistantError(f"No update available for {entity.name}") + raise HomeAssistantError(f"No update available for {entity.entity_id}") # If version is specified, but not supported by the entity. if ( @@ -138,19 +138,19 @@ async def async_install(entity: UpdateEntity, service_call: ServiceCall) -> None and not entity.supported_features & UpdateEntityFeature.SPECIFIC_VERSION ): raise HomeAssistantError( - f"Installing a specific version is not supported for {entity.name}" + f"Installing a specific version is not supported for {entity.entity_id}" ) # If backup is requested, but not supported by the entity. if ( backup := service_call.data[ATTR_BACKUP] ) and not entity.supported_features & UpdateEntityFeature.BACKUP: - raise HomeAssistantError(f"Backup is not supported for {entity.name}") + raise HomeAssistantError(f"Backup is not supported for {entity.entity_id}") # Update is already in progress. if entity.in_progress is not False: raise HomeAssistantError( - f"Update installation already in progress for {entity.name}" + f"Update installation already in progress for {entity.entity_id}" ) await entity.async_install_with_progress(version, backup) @@ -159,7 +159,9 @@ async def async_install(entity: UpdateEntity, service_call: ServiceCall) -> None async def async_skip(entity: UpdateEntity, service_call: ServiceCall) -> None: """Service call wrapper to validate the call.""" if entity.auto_update: - raise HomeAssistantError(f"Skipping update is not supported for {entity.name}") + raise HomeAssistantError( + f"Skipping update is not supported for {entity.entity_id}" + ) await entity.async_skip() @@ -167,7 +169,7 @@ async def async_clear_skipped(entity: UpdateEntity, service_call: ServiceCall) - """Service call wrapper to validate the call.""" if entity.auto_update: raise HomeAssistantError( - f"Clearing skipped update is not supported for {entity.name}" + f"Clearing skipped update is not supported for {entity.entity_id}" ) await entity.async_clear_skipped() diff --git a/tests/components/update/test_init.py b/tests/components/update/test_init.py index 64fed3a212e..29838145db2 100644 --- a/tests/components/update/test_init.py +++ b/tests/components/update/test_init.py @@ -297,7 +297,7 @@ async def test_entity_with_auto_update( # Should not be able to skip the update with pytest.raises( HomeAssistantError, - match="Skipping update is not supported for Update with auto update", + match="Skipping update is not supported for update.update_with_auto_update", ): await hass.services.async_call( DOMAIN, @@ -309,7 +309,7 @@ async def test_entity_with_auto_update( # Should not be able to clear a skipped the update with pytest.raises( HomeAssistantError, - match="Clearing skipped update is not supported for Update with auto update", + match="Clearing skipped update is not supported for update.update_with_auto_update", ): await hass.services.async_call( DOMAIN,